Update handler.py
Browse files- handler.py +2 -1
handler.py
CHANGED
|
@@ -28,12 +28,13 @@ class EndpointHandler:
|
|
| 28 |
|
| 29 |
def inference(self, tokens):
|
| 30 |
generate_kwargs = {
|
| 31 |
-
"max_length":
|
| 32 |
"num_beams": 5,
|
| 33 |
"do_sample": False,
|
| 34 |
"temperature": 0.3,
|
| 35 |
"top_k": 50,
|
| 36 |
"top_p": 0.8,
|
|
|
|
| 37 |
"repetition_penalty": 2.5
|
| 38 |
}
|
| 39 |
with torch.no_grad():
|
|
|
|
| 28 |
|
| 29 |
def inference(self, tokens):
|
| 30 |
generate_kwargs = {
|
| 31 |
+
"max_length": 512,
|
| 32 |
"num_beams": 5,
|
| 33 |
"do_sample": False,
|
| 34 |
"temperature": 0.3,
|
| 35 |
"top_k": 50,
|
| 36 |
"top_p": 0.8,
|
| 37 |
+
"early_stopping": True, # A帽adir explicitamente esta configuraci贸n
|
| 38 |
"repetition_penalty": 2.5
|
| 39 |
}
|
| 40 |
with torch.no_grad():
|