Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ st.write("- ", selected)
|
|
81 |
|
82 |
if selected == "Roberta base squad2":
|
83 |
text0 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?):")
|
84 |
-
if
|
85 |
#######
|
86 |
ans0, score0 = QnAfunction(text0, question_answerer0)
|
87 |
if score0 > 0.5:
|
@@ -89,11 +89,13 @@ if selected == "Roberta base squad2":
|
|
89 |
st.write("Score: ", score0)
|
90 |
else:
|
91 |
st.write(ans0)
|
92 |
-
|
|
|
|
|
93 |
|
94 |
elif selected == "Bert finetuned squad":
|
95 |
text1 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?): ")
|
96 |
-
if
|
97 |
# Fed in the question to the model
|
98 |
ans1, score1 = QnAfunction(text1, question_answerer1)
|
99 |
if score1 > 0.5:
|
@@ -101,3 +103,6 @@ elif selected == "Bert finetuned squad":
|
|
101 |
st.write("Score: ", score1)
|
102 |
else:
|
103 |
st.write(ans1)
|
|
|
|
|
|
|
|
81 |
|
82 |
if selected == "Roberta base squad2":
|
83 |
text0 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?):")
|
84 |
+
if len(text) > 0 and len(text) <= 350:
|
85 |
#######
|
86 |
ans0, score0 = QnAfunction(text0, question_answerer0)
|
87 |
if score0 > 0.5:
|
|
|
89 |
st.write("Score: ", score0)
|
90 |
else:
|
91 |
st.write(ans0)
|
92 |
+
|
93 |
+
elif len(text) > 350:
|
94 |
+
st.write("Max characters: 350")
|
95 |
|
96 |
elif selected == "Bert finetuned squad":
|
97 |
text1 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?): ")
|
98 |
+
if len(text) > 0 and len(text) <= 350:
|
99 |
# Fed in the question to the model
|
100 |
ans1, score1 = QnAfunction(text1, question_answerer1)
|
101 |
if score1 > 0.5:
|
|
|
103 |
st.write("Score: ", score1)
|
104 |
else:
|
105 |
st.write(ans1)
|
106 |
+
|
107 |
+
elif len(text) > 350:
|
108 |
+
st.write("Max characters: 350")
|