Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
-
gr.Interface(analyze_argument, inputs="text", outputs="text"
|
|
|
|
|
|
| 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()
|