Update handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
@@ -93,7 +93,10 @@ class EndpointHandler():
|
|
93 |
base_lambda=1.,
|
94 |
) -> List[Dict[str, Any]]:
|
95 |
|
96 |
-
inputs = query.pop("inputs",query)
|
|
|
|
|
|
|
97 |
inputs = self.tokenizer(query, return_tensors="pt").to("cuda")
|
98 |
with torch.no_grad():
|
99 |
outputs = self.model(**inputs)
|
|
|
93 |
base_lambda=1.,
|
94 |
) -> List[Dict[str, Any]]:
|
95 |
|
96 |
+
inputs = query.pop("inputs", query)
|
97 |
+
print(type(inputs))
|
98 |
+
if isinstance(inputs, str):
|
99 |
+
inputs = [inputs]
|
100 |
inputs = self.tokenizer(query, return_tensors="pt").to("cuda")
|
101 |
with torch.no_grad():
|
102 |
outputs = self.model(**inputs)
|