Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def generate(input):
|
|
13 |
tokenized = tokenizer(input, return_tensors="pt")["input_ids"]
|
14 |
outputs = model.generate(tokenized, max_new_tokens=80, do_sample=True, temperature=0.9)
|
15 |
decoded = tokenizer.decode(outputs[0])
|
16 |
-
return decoded
|
17 |
|
18 |
iface = gr.Interface(fn=generate, inputs="text", outputs="text")
|
19 |
iface.launch()
|
|
|
13 |
tokenized = tokenizer(input, return_tensors="pt")["input_ids"]
|
14 |
outputs = model.generate(tokenized, max_new_tokens=80, do_sample=True, temperature=0.9)
|
15 |
decoded = tokenizer.decode(outputs[0])
|
16 |
+
return decoded[len(input):len(decoded)].replace("</s>", "");
|
17 |
|
18 |
iface = gr.Interface(fn=generate, inputs="text", outputs="text")
|
19 |
iface.launch()
|