Spaces:
Sleeping
Sleeping
Commit
·
1dee0bd
1
Parent(s):
6f4a27c
Update app.py
Browse files
app.py
CHANGED
@@ -62,17 +62,18 @@ def get_question(sentence,answer):
|
|
62 |
outs = question_model.generate(input_ids=input_ids,
|
63 |
attention_mask=attention_mask,
|
64 |
early_stopping=True,
|
65 |
-
num_beams=
|
66 |
-
num_return_sequences=
|
67 |
no_repeat_ngram_size=2,
|
68 |
max_length=200)
|
69 |
|
70 |
|
71 |
dec = [question_tokenizer.decode(ids) for ids in outs]
|
72 |
|
73 |
-
Question = dec[0].replace("question:","")
|
74 |
-
Question= Question.strip()
|
75 |
-
return Question
|
|
|
76 |
|
77 |
input_context = gr.Textbox()
|
78 |
input_answer = gr.Textbox()
|
|
|
62 |
outs = question_model.generate(input_ids=input_ids,
|
63 |
attention_mask=attention_mask,
|
64 |
early_stopping=True,
|
65 |
+
num_beams=3,
|
66 |
+
num_return_sequences=3,
|
67 |
no_repeat_ngram_size=2,
|
68 |
max_length=200)
|
69 |
|
70 |
|
71 |
dec = [question_tokenizer.decode(ids) for ids in outs]
|
72 |
|
73 |
+
#Question = dec[0].replace("question:","")
|
74 |
+
#Question= Question.strip()
|
75 |
+
#return Question
|
76 |
+
return dec
|
77 |
|
78 |
input_context = gr.Textbox()
|
79 |
input_answer = gr.Textbox()
|