wealthcoders commited on
Commit
ca17628
·
verified ·
1 Parent(s): 3fdba7b

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -2
handler.py CHANGED
@@ -1,5 +1,6 @@
1
  from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
2
-
 
3
 
4
  class EndpointHandler:
5
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]):
@@ -24,4 +25,4 @@ class EndpointHandler:
24
 
25
  generated_ids = model.generate(**inputs, max_new_tokens=128)
26
  output_text = processor.batch_decode(generated_ids, skip_special_tokens=True)
27
- return output_text[0])
 
1
  from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
2
+ from typing import Dict, List, Any
3
+ import torch
4
 
5
  class EndpointHandler:
6
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]):
 
25
 
26
  generated_ids = model.generate(**inputs, max_new_tokens=128)
27
  output_text = processor.batch_decode(generated_ids, skip_special_tokens=True)
28
+ return output_text[0]