Spaces:
Runtime error
Runtime error
revert
Browse files
app.py
CHANGED
|
@@ -51,8 +51,16 @@ def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
|
| 51 |
}
|
| 52 |
|
| 53 |
payload = {"inputs": input_sentence, "parameters": parameters,"options" : {"use_cache": False} }
|
| 54 |
-
|
| 55 |
-
pipe = pipeline("text-generation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
res = pipe(input_sentence)
|
| 57 |
|
| 58 |
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
payload = {"inputs": input_sentence, "parameters": parameters,"options" : {"use_cache": False} }
|
| 54 |
+
model_name = 'bigscience/bloomz-560m'
|
| 55 |
+
pipe = pipeline("text-generation",
|
| 56 |
+
model = model_name,
|
| 57 |
+
tokenizer = model_name,
|
| 58 |
+
max_new_tokens = max_length,
|
| 59 |
+
do_sample = False,
|
| 60 |
+
length_penalty = 0.0,
|
| 61 |
+
early_stopping = False,
|
| 62 |
+
eos_token_id = None
|
| 63 |
+
)
|
| 64 |
res = pipe(input_sentence)
|
| 65 |
|
| 66 |
|