ThangDinh commited on
Commit
adef15b
·
1 Parent(s): 0dc5a9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,13 +7,14 @@ MODEL = "ThangDinh/qthang-finetuned"
7
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = HUGGINGFACEHUB_API_TOKEN
8
 
9
  client = InferenceClient(model=MODEL)
10
- prompt = st.chat_input("Say something")
 
11
 
12
- if prompt:
13
  st.write("loading...")
14
 
15
- answer = client.question_answering(prompt)
16
- st.write(f"User has sent the following prompt: {answer}")
17
 
18
  print("done")
19
 
 
7
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = HUGGINGFACEHUB_API_TOKEN
8
 
9
  client = InferenceClient(model=MODEL)
10
+ question = st.chat_input("Write your question")
11
+ context = st.chat_input("Write your context")
12
 
13
+ if question:
14
  st.write("loading...")
15
 
16
+ answer = client.question_answering(question=question, context=context)
17
+ st.write(f"User has sent the following prompt: {answer["answer"]}")
18
 
19
  print("done")
20