vivek01 commited on
Commit
3667632
·
verified ·
1 Parent(s): b9bce35

Update handler.py to handle lists

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -41,7 +41,7 @@ class EndpointHandler:
41
  batch_texts = texts[i:i+batch_size]
42
 
43
  # Tokenize the input text
44
- inputs = self.tokenizer(text, return_tensors='pt', max_length=256, truncation=True, padding=True)
45
  if 'token_type_ids' in inputs:
46
  del inputs['token_type_ids']
47
  inputs = {key: val.to(self.device) for key, val in inputs.items()}
 
41
  batch_texts = texts[i:i+batch_size]
42
 
43
  # Tokenize the input text
44
+ inputs = self.tokenizer(batch_texts, return_tensors='pt', max_length=256, truncation=True, padding=True)
45
  if 'token_type_ids' in inputs:
46
  del inputs['token_type_ids']
47
  inputs = {key: val.to(self.device) for key, val in inputs.items()}