minjibi commited on
Commit
62fd772
·
1 Parent(s): 3970371

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,7 +40,7 @@ def predict(text):
40
 
41
  output = ['Question: '+ text.replace('A', 'Answer') for text in preds]
42
  #final_str = '\n'.join([f"{i+1}. {s}" for i, s in enumerate(output)])
43
- final_str = '\n'.join([f"{i+1}. Question: {s.split('Answer')[0].strip()}\n Answer{s.split('Answer')[1].strip()}" for i, s in enumerate(output)])
44
 
45
  return final_str
46
 
@@ -48,5 +48,5 @@ def predict(text):
48
  # predicted = ['Q: ' + text for text in predict(text_to_predict)]
49
  # predicted
50
 
51
- iface = gr.Interface(fn=predict, inputs="text", outputs="text")
52
  iface.launch()
 
40
 
41
  output = ['Question: '+ text.replace('A', 'Answer') for text in preds]
42
  #final_str = '\n'.join([f"{i+1}. {s}" for i, s in enumerate(output)])
43
+ final_str = '\n'.join([f"{i+1}. Question: {s.split('Answer')[0].strip()}\n Answer{s.split('Answer')[1].strip()}" for i, s in enumerate(output)])
44
 
45
  return final_str
46
 
 
48
  # predicted = ['Q: ' + text for text in predict(text_to_predict)]
49
  # predicted
50
 
51
+ iface = gr.Interface(fn=predict, inputs="Thai Context", outputs="Question-Answer")
52
  iface.launch()