ToletiSri commited on
Commit
0941483
1 Parent(s): 32bb922

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -27,7 +27,9 @@ class _MLPVectorProjector(nn.Module):
27
 
28
  model_name = "microsoft/phi-2"
29
 
30
- phi2_text = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
 
 
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
- phi2_finetuned = AutoModelForCausalLM.from_pretrained(
71
- "phi2_adaptor_fineTuned", trust_remote_code=True,
72
- torch_dtype = torch.float32).to("cpu")
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