ZongqianLi commited on
Commit
f63a516
·
verified ·
1 Parent(s): c007f22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -25,13 +25,16 @@ st.write(f"Your selected model: {model}")
25
  # 加载问答模型
26
  pipe = pipeline("question-answering", model=model)
27
 
 
 
 
 
28
  # 获取用户输入的问题和上下文
29
- question = st.text_input("Enter your question here")
30
- context = st.text_area("Enter the context here")
31
 
32
  # 添加一个按钮,用户点击后执行问答
33
  if st.button('Answer the Question'):
34
- progress_bar = st.progress(0)
35
  if context and question:
36
  out = pipe({
37
  'question': question,
 
25
  # 加载问答模型
26
  pipe = pipeline("question-answering", model=model)
27
 
28
+ # 设置默认的问题和上下文
29
+ default_question = "What is the value of FF?"
30
+ default_context = "The referential DSSC with Pt CE was also measured under the same conditions, which yields η of 6.66% (Voc= 0.78 V, Jsc= 13.0 mA cm−2, FF = 65.9%)."
31
+
32
  # 获取用户输入的问题和上下文
33
+ question = st.text_input("Enter your question here", value=default_question)
34
+ context = st.text_area("Enter the context here", value=default_context, height=300)
35
 
36
  # 添加一个按钮,用户点击后执行问答
37
  if st.button('Answer the Question'):
 
38
  if context and question:
39
  out = pipe({
40
  'question': question,