Update handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
|
@@ -20,7 +20,10 @@ class EndpointHandler():
|
|
| 20 |
|
| 21 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 22 |
inputs = data.pop("inputs", "Q: What is the chemical composition of common concrete in 2024?\nA: ")
|
| 23 |
-
max_new_tokens =
|
|
|
|
|
|
|
|
|
|
| 24 |
try:
|
| 25 |
max_new_tokens = int(max_new_tokens)
|
| 26 |
except Exception as e:
|
|
|
|
| 20 |
|
| 21 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 22 |
inputs = data.pop("inputs", "Q: What is the chemical composition of common concrete in 2024?\nA: ")
|
| 23 |
+
max_new_tokens = 1024
|
| 24 |
+
if "max_new_tokens" in data:
|
| 25 |
+
max_new_tokens = data.pop("max_new_tokens")
|
| 26 |
+
max_new_tokens = int(max_new_tokens)
|
| 27 |
try:
|
| 28 |
max_new_tokens = int(max_new_tokens)
|
| 29 |
except Exception as e:
|