Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -26,8 +26,7 @@ def generate_text(inp, history):
|
|
26 |
input_ids = tokenizer(inp, return_tensors='pt').to("cuda")
|
27 |
beam_output = model.generate(**input_ids, generation_config=generation_config)
|
28 |
output = tokenizer.decode(beam_output[0], skip_special_token=True)
|
29 |
-
output = output.replace(inp,"")
|
30 |
-
print(output)
|
31 |
return output
|
32 |
|
33 |
gr.ChatInterface(generate_text).launch()
|
|
|
26 |
input_ids = tokenizer(inp, return_tensors='pt').to("cuda")
|
27 |
beam_output = model.generate(**input_ids, generation_config=generation_config)
|
28 |
output = tokenizer.decode(beam_output[0], skip_special_token=True)
|
29 |
+
output = output.replace(inp,"").replace("<s>","").replace("</s>","")
|
|
|
30 |
return output
|
31 |
|
32 |
gr.ChatInterface(generate_text).launch()
|