Aekanun commited on
Commit
12edec8
·
1 Parent(s): b32837f
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -143,8 +143,6 @@ def load_model():
143
  torch_dtype=torch.float16
144
  ).to('cuda')
145
 
146
- FastVisionModel.for_inference(model) ###ลองแก้ไขปัญหา torch
147
-
148
  print("โหลดโมเดลสำเร็จ!")
149
  return True
150
 
@@ -164,6 +162,9 @@ def process_image(image):
164
 
165
  ### โหลด tokenizer จาก base model
166
  from unsloth import FastVisionModel
 
 
 
167
  from transformers import AutoTokenizer
168
  print("กำลังโหลด tokenizer...")
169
  base_model, tokenizer = FastVisionModel.from_pretrained(
 
143
  torch_dtype=torch.float16
144
  ).to('cuda')
145
 
 
 
146
  print("โหลดโมเดลสำเร็จ!")
147
  return True
148
 
 
162
 
163
  ### โหลด tokenizer จาก base model
164
  from unsloth import FastVisionModel
165
+
166
+ FastVisionModel.for_inference(model) ###ลองแก้ไขปัญหา torch
167
+
168
  from transformers import AutoTokenizer
169
  print("กำลังโหลด tokenizer...")
170
  base_model, tokenizer = FastVisionModel.from_pretrained(