amy011872 commited on
Commit
f733183
1 Parent(s): 7ed842f

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +6 -4
handler.py CHANGED
@@ -94,12 +94,14 @@ class EndpointHandler():
94
 
95
  max_new_tokens=5
96
  do_sample=False
97
- topk=3
98
  base_lambda=1.
 
99
  inputs = query.pop("inputs", query)
100
- logger.info(type(inputs))
101
- if isinstance(inputs, str):
102
- inputs = [inputs]
 
103
  inputs = self.tokenizer(inputs, return_tensors="pt").to("cuda")
104
  with torch.no_grad():
105
  outputs = self.model(**inputs)
 
94
 
95
  max_new_tokens=5
96
  do_sample=False
97
+ topk=5
98
  base_lambda=1.
99
+
100
  inputs = query.pop("inputs", query)
101
+ # if isinstance(inputs, str):
102
+ # inputs = [inputs]
103
+ if not inputs.endswith("<cite>"):
104
+ inputs += "<cite>"
105
  inputs = self.tokenizer(inputs, return_tensors="pt").to("cuda")
106
  with torch.no_grad():
107
  outputs = self.model(**inputs)