Spaces:
Sleeping
Sleeping
Fixing conditions
Browse files
app.py
CHANGED
|
@@ -31,9 +31,9 @@ if generate_button:
|
|
| 31 |
for sentence in sentences:
|
| 32 |
try:
|
| 33 |
output = model(f"ask: {sentence}")[0]['generated_text']
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
except:
|
| 39 |
st.warning('An error occurred while generating the question.')
|
|
|
|
| 31 |
for sentence in sentences:
|
| 32 |
try:
|
| 33 |
output = model(f"ask: {sentence}")[0]['generated_text']
|
| 34 |
+
if len(output.split("?")) == 2:
|
| 35 |
+
question, answer = output.split("?")
|
| 36 |
+
if answer not in question:
|
| 37 |
+
st.write(output)
|
| 38 |
except:
|
| 39 |
st.warning('An error occurred while generating the question.')
|