Update app.py
Browse files
app.py
CHANGED
@@ -59,13 +59,13 @@ def encode_image(image_path):
|
|
59 |
return img_embedding
|
60 |
|
61 |
#Get the projection model
|
62 |
-
img_proj_head = _MLPVectorProjector(512, 2560, 1, 4).to("
|
63 |
img_proj_head.load_state_dict(torch.load('projection_finetuned.pth'))
|
64 |
|
65 |
#Get the fine-tuned phi-2 model
|
66 |
phi2_finetuned = AutoModelForCausalLM.from_pretrained(
|
67 |
"phi2_adaptor_fineTuned", trust_remote_code=True,
|
68 |
-
torch_dtype = torch.float32).to("
|
69 |
|
70 |
|
71 |
def example_inference(input_text, count): #, image, img_qn, audio):
|
|
|
59 |
return img_embedding
|
60 |
|
61 |
#Get the projection model
|
62 |
+
img_proj_head = _MLPVectorProjector(512, 2560, 1, 4).to("cpu")
|
63 |
img_proj_head.load_state_dict(torch.load('projection_finetuned.pth'))
|
64 |
|
65 |
#Get the fine-tuned phi-2 model
|
66 |
phi2_finetuned = AutoModelForCausalLM.from_pretrained(
|
67 |
"phi2_adaptor_fineTuned", trust_remote_code=True,
|
68 |
+
torch_dtype = torch.float32).to("cpu")
|
69 |
|
70 |
|
71 |
def example_inference(input_text, count): #, image, img_qn, audio):
|