dantedgp commited on
Commit
8ea2796
·
1 Parent(s): 589481f

Fixing conditions

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- question, answer = output.split("?")
35
-
36
- if question and answer and answer not in question:
37
- st.write(output)
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.')