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 +8 -8
handler.py
CHANGED
|
@@ -16,8 +16,8 @@ class EndpointHandler:
|
|
| 16 |
input_text = (
|
| 17 |
f"""
|
| 18 |
Por favor, genera un JSON válido basado en las siguientes especificaciones:
|
| 19 |
-
|
| 20 |
-
|
| 21 |
{{
|
| 22 |
"values": [
|
| 23 |
{{
|
|
@@ -36,7 +36,7 @@ class EndpointHandler:
|
|
| 36 |
"id": "adress",
|
| 37 |
"value": [
|
| 38 |
{{
|
| 39 |
-
"id": "[MOBILE
|
| 40 |
"value": "STRING"
|
| 41 |
}}
|
| 42 |
]
|
|
@@ -45,7 +45,7 @@ class EndpointHandler:
|
|
| 45 |
"id": "email",
|
| 46 |
"value": [
|
| 47 |
{{
|
| 48 |
-
"id": "[MOBILE
|
| 49 |
"value": "STRING"
|
| 50 |
}}
|
| 51 |
]
|
|
@@ -54,7 +54,7 @@ class EndpointHandler:
|
|
| 54 |
"id": "phone",
|
| 55 |
"value": [
|
| 56 |
{{
|
| 57 |
-
"id": "[MOBILE
|
| 58 |
"value": "STRING (ONLY NUMBERS)"
|
| 59 |
}}
|
| 60 |
]
|
|
@@ -65,11 +65,11 @@ class EndpointHandler:
|
|
| 65 |
}},
|
| 66 |
{{
|
| 67 |
"id": "roleFunction",
|
| 68 |
-
"value": "[BUYER
|
| 69 |
}}
|
| 70 |
]
|
| 71 |
}}
|
| 72 |
-
|
| 73 |
Para el texto de entrada: "Hablé con Ana López, CEO de Innovatech. Su número es 654 321 987 y su correo es alopez@innovatech.com."
|
| 74 |
La salida sería:
|
| 75 |
{{
|
|
@@ -94,7 +94,7 @@ class EndpointHandler:
|
|
| 94 |
"max_length": 1000,
|
| 95 |
"num_beams": 5,
|
| 96 |
"do_sample": True,
|
| 97 |
-
"temperature": 0.
|
| 98 |
"top_k": 50,
|
| 99 |
"top_p": 0.9,
|
| 100 |
"repetition_penalty": 2.5
|
|
|
|
| 16 |
input_text = (
|
| 17 |
f"""
|
| 18 |
Por favor, genera un JSON válido basado en las siguientes especificaciones:
|
| 19 |
+
Las ids son unicas y debes elegir entre una de ellas cuando estan separadas por un /, el value del roleFuntcion tambien sique esta instruccion
|
| 20 |
+
TEMPLATE JSON esperada:
|
| 21 |
{{
|
| 22 |
"values": [
|
| 23 |
{{
|
|
|
|
| 36 |
"id": "adress",
|
| 37 |
"value": [
|
| 38 |
{{
|
| 39 |
+
"id": "[MOBILE/WORK/PERSONAL/MAIN/OTHER]",
|
| 40 |
"value": "STRING"
|
| 41 |
}}
|
| 42 |
]
|
|
|
|
| 45 |
"id": "email",
|
| 46 |
"value": [
|
| 47 |
{{
|
| 48 |
+
"id": "[MOBILE/WORK-PERSONAL/MAIN/OTHER]",
|
| 49 |
"value": "STRING"
|
| 50 |
}}
|
| 51 |
]
|
|
|
|
| 54 |
"id": "phone",
|
| 55 |
"value": [
|
| 56 |
{{
|
| 57 |
+
"id": "[MOBILE/WORK/PERSONAL/MAIN/OTHER]",
|
| 58 |
"value": "STRING (ONLY NUMBERS)"
|
| 59 |
}}
|
| 60 |
]
|
|
|
|
| 65 |
}},
|
| 66 |
{{
|
| 67 |
"id": "roleFunction",
|
| 68 |
+
"value": "[BUYER/SELLER/SUPPLIER/PARTNER/COLLABORATOR/PROVIDER/CUSTOMER]"
|
| 69 |
}}
|
| 70 |
]
|
| 71 |
}}
|
| 72 |
+
-- Ejemplo
|
| 73 |
Para el texto de entrada: "Hablé con Ana López, CEO de Innovatech. Su número es 654 321 987 y su correo es alopez@innovatech.com."
|
| 74 |
La salida sería:
|
| 75 |
{{
|
|
|
|
| 94 |
"max_length": 1000,
|
| 95 |
"num_beams": 5,
|
| 96 |
"do_sample": True,
|
| 97 |
+
"temperature": 0.1,
|
| 98 |
"top_k": 50,
|
| 99 |
"top_p": 0.9,
|
| 100 |
"repetition_penalty": 2.5
|