amy011872 commited on
Commit
319721c
1 Parent(s): 9ce16dd

Update handler.py

Browse files
Files changed (1) hide show
  1. 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)