cris177 commited on
Commit
2dc5a8b
·
verified ·
1 Parent(s): c391062

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -20,7 +20,11 @@ def analyze_argument(argument):
20
  input_ids = tokenizer(prompt, return_tensors="pt")
21
 
22
  outputs = model.generate(**input_ids, max_length=1000, num_return_sequences=1)
23
- return tokenizer.decode(outputs[0])
 
 
 
24
 
25
 
26
- gr.Interface(analyze_argument, inputs="text", outputs="text").launch()
 
 
20
  input_ids = tokenizer(prompt, return_tensors="pt")
21
 
22
  outputs = model.generate(**input_ids, max_length=1000, num_return_sequences=1)
23
+ output = tokenizer.decode(outputs[0])
24
+ # remove prompt from output
25
+ output = output.split("### Response:")[1].strip().split("<|endoftext|>")[0]
26
+ return output
27
 
28
 
29
+ gr.Interface(analyze_argument, inputs="text", outputs="text",
30
+ examples=[["If it's wednesday it's cold, and it's cold, therefore it's wednesday."]]).launch()