Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,8 @@ else:
|
|
38 |
model = "".join(["ZongqianLi/bert", size, cased, fpretrain, finetune])
|
39 |
|
40 |
# 显示用户选择的模型
|
41 |
-
st.write(f"Your selected model:
|
|
|
42 |
|
43 |
# 加载问答模型
|
44 |
pipe = pipeline("question-answering", model=model)
|
@@ -93,8 +94,9 @@ with col2:
|
|
93 |
'question': question,
|
94 |
'context': context
|
95 |
})
|
|
|
96 |
st.write(f"Question: {question}")
|
97 |
-
st.write(f"Answer: {
|
98 |
else:
|
99 |
st.write("Please enter both a question and context.")
|
100 |
|
|
|
38 |
model = "".join(["ZongqianLi/bert", size, cased, fpretrain, finetune])
|
39 |
|
40 |
# 显示用户选择的模型
|
41 |
+
st.write(f"Your selected model:")
|
42 |
+
st.markdown(f'#### {model}', unsafe_allow_html=True)
|
43 |
|
44 |
# 加载问答模型
|
45 |
pipe = pipeline("question-answering", model=model)
|
|
|
94 |
'question': question,
|
95 |
'context': context
|
96 |
})
|
97 |
+
answer = out["answer"]
|
98 |
st.write(f"Question: {question}")
|
99 |
+
st.write(f"Answer: {answer}")
|
100 |
else:
|
101 |
st.write("Please enter both a question and context.")
|
102 |
|