Sahibsingh12 commited on
Commit
03a6d30
1 Parent(s): aeacbe1

files changed

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,10 +18,10 @@ def infer(text):
18
  inputs = tokenizer(f'''question: {text} answer: ''', return_tensors="pt", return_attention_mask=False)
19
  outputs = model.generate(**inputs, max_length=116)
20
  text = tokenizer.batch_decode(outputs)[0]
 
21
  return text
22
 
23
- def greet(name):
24
- return "Hello " + name + "!!"
25
 
26
  iface = gr.Interface(fn=infer, inputs="text", outputs="text")
27
  iface.launch(share=True)
 
18
  inputs = tokenizer(f'''question: {text} answer: ''', return_tensors="pt", return_attention_mask=False)
19
  outputs = model.generate(**inputs, max_length=116)
20
  text = tokenizer.batch_decode(outputs)[0]
21
+ text = text.split('answer:',1)[1]
22
  return text
23
 
24
+
 
25
 
26
  iface = gr.Interface(fn=infer, inputs="text", outputs="text")
27
  iface.launch(share=True)