spuun commited on
Commit
2cdacf8
1 Parent(s): fe673de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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.slice(len(input), len(decoded)).replace("</s>", "");
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()