Spaces:
Build error
Build error
Commit
·
cc276cb
1
Parent(s):
f3ba36c
Update app.py
Browse files
app.py
CHANGED
@@ -35,9 +35,9 @@ def genQuestion(model_choice, context):
|
|
35 |
# descriptions = "Reverse interview question is a model that..."
|
36 |
|
37 |
inputs = tok(context, return_tensors="pt")
|
38 |
-
output = model.generate(inputs["input_ids"], num_beams=
|
39 |
final_output = ''
|
40 |
-
for i in range(
|
41 |
final_output += [tok.decode(beam, skip_special_tokens=True, clean_up_tokenization_spaces=False) for beam in output][i] + "\n\n"
|
42 |
|
43 |
return final_output
|
|
|
35 |
# descriptions = "Reverse interview question is a model that..."
|
36 |
|
37 |
inputs = tok(context, return_tensors="pt")
|
38 |
+
output = model.generate(inputs["input_ids"], num_beams=4, max_length=64, min_length=9, num_return_sequences=4, diversity_penalty=1.0, num_beam_groups=4)
|
39 |
final_output = ''
|
40 |
+
for i in range(4):
|
41 |
final_output += [tok.decode(beam, skip_special_tokens=True, clean_up_tokenization_spaces=False) for beam in output][i] + "\n\n"
|
42 |
|
43 |
return final_output
|