Spaces:
Runtime error
Runtime error
new
Browse files
app.py
CHANGED
|
@@ -53,10 +53,8 @@ def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
|
| 53 |
pipe = pipeline("text-generation", model = model_name, tokenizer = model_name)
|
| 54 |
|
| 55 |
if sample_or_greedy == "Sample":
|
| 56 |
-
res = pipe(input_sentence,
|
| 57 |
-
|
| 58 |
-
tokenizer = model_name,
|
| 59 |
-
max_new_tokens = 23,
|
| 60 |
do_sample = False,
|
| 61 |
top_p = 0.9,
|
| 62 |
length_penalty = 0.0,
|
|
@@ -65,9 +63,7 @@ def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
|
| 65 |
)
|
| 66 |
else:
|
| 67 |
res = pipe(input_sentence,
|
| 68 |
-
|
| 69 |
-
tokenizer = model_name,
|
| 70 |
-
max_new_tokens = 23,
|
| 71 |
do_sample = False,
|
| 72 |
length_penalty = 0.0,
|
| 73 |
early_stopping = False,
|
|
|
|
| 53 |
pipe = pipeline("text-generation", model = model_name, tokenizer = model_name)
|
| 54 |
|
| 55 |
if sample_or_greedy == "Sample":
|
| 56 |
+
res = pipe(input_sentence,
|
| 57 |
+
max_new_tokens = max_length,
|
|
|
|
|
|
|
| 58 |
do_sample = False,
|
| 59 |
top_p = 0.9,
|
| 60 |
length_penalty = 0.0,
|
|
|
|
| 63 |
)
|
| 64 |
else:
|
| 65 |
res = pipe(input_sentence,
|
| 66 |
+
max_new_tokens = max_length,
|
|
|
|
|
|
|
| 67 |
do_sample = False,
|
| 68 |
length_penalty = 0.0,
|
| 69 |
early_stopping = False,
|