Commit
•
882be2c
1
Parent(s):
ed738dc
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def generate(commentary_text):
|
|
12 |
input_ids = trained_tokenizer(commentary_text, return_tensors="pt")
|
13 |
input_ids = input_ids['input_ids'].to(device)
|
14 |
output = trained_model.generate(input_ids, max_length=60, num_beams=5, do_sample=False)
|
15 |
-
return
|
16 |
|
17 |
# Create Gradio interface
|
18 |
iface = gr.Interface(fn=generate,
|
|
|
12 |
input_ids = trained_tokenizer(commentary_text, return_tensors="pt")
|
13 |
input_ids = input_ids['input_ids'].to(device)
|
14 |
output = trained_model.generate(input_ids, max_length=60, num_beams=5, do_sample=False)
|
15 |
+
return trained_tokenizer.decode(output[0])
|
16 |
|
17 |
# Create Gradio interface
|
18 |
iface = gr.Interface(fn=generate,
|