Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,9 @@ class _MLPVectorProjector(nn.Module):
|
|
27 |
|
28 |
model_name = "microsoft/phi-2"
|
29 |
|
30 |
-
|
|
|
|
|
31 |
tokenizer_text = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
32 |
|
33 |
## Audio model
|
@@ -67,9 +69,9 @@ img_proj_head.load_state_dict(torch.load('projection_finetuned.pth', map_locati
|
|
67 |
print('--------------Loaded proj head----------------------')
|
68 |
|
69 |
#Get the fine-tuned phi-2 model
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
74 |
print('--------------Loaded fine tuned phi2 model----------------------')
|
75 |
|
|
|
27 |
|
28 |
model_name = "microsoft/phi-2"
|
29 |
|
30 |
+
with torch.no_grad():
|
31 |
+
phi2_text = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
32 |
+
|
33 |
tokenizer_text = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
34 |
|
35 |
## Audio model
|
|
|
69 |
print('--------------Loaded proj head----------------------')
|
70 |
|
71 |
#Get the fine-tuned phi-2 model
|
72 |
+
with torch.no_grad():
|
73 |
+
phi2_finetuned = AutoModelForCausalLM.from_pretrained(
|
74 |
+
"phi2_adaptor_fineTuned", trust_remote_code=True).to("cpu")
|
75 |
|
76 |
print('--------------Loaded fine tuned phi2 model----------------------')
|
77 |
|