Update app.py
Browse files
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 |
-
|
|
|
11 |
|
12 |
-
if
|
13 |
st.write("loading...")
|
14 |
|
15 |
-
answer = client.question_answering(
|
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 |
|