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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -43,10 +43,13 @@ def predict(text):
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
-
47
- # text_to_predict = predict(text)
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()
 
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
 
47
+ examples = [
48
+ {
49
+ "input": "วันนี้อากาศดีจัง",
50
+ "output": "1. Question: อากาศวันนี้เป็นอย่างไร\n Answer: ดี"
51
+ }
52
+ ]
53
+
54
+ iface = gr.Interface(fn=predict, inputs="text", outputs="Question-Answer", examples=examples)
55
  iface.launch()