Spaces:
Runtime error
Runtime error
webapp update 03-07-2022 6:19 pm
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def genQuestion(context):
|
|
10 |
inputs = tok(context, return_tensors="pt")
|
11 |
output = model.generate(inputs["input_ids"], num_beams=4, max_length=64)
|
12 |
|
13 |
-
return
|
14 |
-
|
15 |
iface = gr.Interface(fn=genQuestion, inputs="text", outputs="text")
|
16 |
iface.launch()
|
|
|
10 |
inputs = tok(context, return_tensors="pt")
|
11 |
output = model.generate(inputs["input_ids"], num_beams=4, max_length=64)
|
12 |
|
13 |
+
return [tokenizer.decode(beam, skip_special_tokens=True, clean_up_tokenization_spaces=False) for beam in output][0]
|
14 |
+
|
15 |
iface = gr.Interface(fn=genQuestion, inputs="text", outputs="text")
|
16 |
iface.launch()
|