SwordElucidator commited on
Commit
e03c554
1 Parent(s): 9b4fe66

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -2,14 +2,14 @@ from io import BytesIO
2
  from typing import Any, List, Dict
3
 
4
  from PIL import Image
5
- from transformers import AutoTokenizer, AutoModelForVision2Seq
6
 
7
 
8
  class EndpointHandler():
9
  def __init__(self, path=""):
10
  # Use a pipeline as a high-level helper
11
  model_name = "SwordElucidator/MiniCPM-Llama3-V-2_5-int4"
12
- model = AutoModelForVision2Seq.from_pretrained(model_name, trust_remote_code=True)
13
  tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
14
  model.eval()
15
  self.model = model
@@ -31,4 +31,4 @@ class EndpointHandler():
31
  # system_prompt='' # pass system_prompt if needed
32
  )
33
 
34
- return res
 
2
  from typing import Any, List, Dict
3
 
4
  from PIL import Image
5
+ from transformers import AutoModel, AutoTokenizer
6
 
7
 
8
  class EndpointHandler():
9
  def __init__(self, path=""):
10
  # Use a pipeline as a high-level helper
11
  model_name = "SwordElucidator/MiniCPM-Llama3-V-2_5-int4"
12
+ model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
13
  tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
14
  model.eval()
15
  self.model = model
 
31
  # system_prompt='' # pass system_prompt if needed
32
  )
33
 
34
+ return res