Instructions to use jla25/squareV3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jla25/squareV3 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("jla25/squareV3") model = AutoModelForSeq2SeqLM.from_pretrained("jla25/squareV3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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():
|