ZongqianLi commited on
Commit
87f3f0e
·
verified ·
1 Parent(s): b8daae8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -24
app.py CHANGED
@@ -50,6 +50,33 @@ col1, col2 = st.columns(2)
50
 
51
  with col1:
52
  if st.button("Solar Cell QA Dataset"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  default_property = "FF"
54
  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%)."
55
 
@@ -78,30 +105,7 @@ with col1:
78
  st.write(f"First-turn answer: {material}")
79
  else:
80
  st.write("Please enter both a question and context.")
81
-
82
- with col2:
83
- if st.button("SuAD Dataset QA"):
84
- default_question = "To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?"
85
- default_context = """Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend "Venite Ad Me Omnes". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary."""
86
-
87
- question = st.text_input("Enter your the name of the property: ", value=default_property)
88
- context = st.text_area("Enter the context: ", value=default_context, height=100)
89
-
90
- # 添加一个按钮,用户点击后执行问答
91
- if st.button('Extract the answer'):
92
- if context and question:
93
- out = pipe({
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
-
103
-
104
-
105
 
106
 
107
 
 
50
 
51
  with col1:
52
  if st.button("Solar Cell QA Dataset"):
53
+ default_question = "What is the value of FF?"
54
+ 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%)."
55
+
56
+
57
+ with col2:
58
+ if st.button("SuAD Dataset QA"):
59
+ default_question = "To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?"
60
+ default_context = """Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend "Venite Ad Me Omnes". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary."""
61
+
62
+ question = st.text_input("Enter the question: ", value=default_property)
63
+ context = st.text_area("Enter the context: ", value=default_context, height=100)
64
+
65
+ # 添加一个按钮,用户点击后执行问答
66
+ if st.button('Extract the answer'):
67
+ if context and question:
68
+ out = pipe({
69
+ 'question': question,
70
+ 'context': context
71
+ })
72
+ answer = out["answer"]
73
+ st.write(f"Question: {question}")
74
+ st.write(f"Answer: {answer}")
75
+ else:
76
+ st.write("Please enter both a question and context.")
77
+
78
+
79
+ """
80
  default_property = "FF"
81
  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%)."
82
 
 
105
  st.write(f"First-turn answer: {material}")
106
  else:
107
  st.write("Please enter both a question and context.")
108
+ """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
 
111