Spaces:
Sleeping
Sleeping
Update minigpt4/models/mini_gpt4.py
Browse files
minigpt4/models/mini_gpt4.py
CHANGED
@@ -38,7 +38,7 @@ class MiniGPT4(Blip2Base):
|
|
38 |
freeze_vit=True,
|
39 |
freeze_qformer=True,
|
40 |
num_query_token=32,
|
41 |
-
llama_model="
|
42 |
llama_cache_dir='',
|
43 |
prompt_path="",
|
44 |
prompt_template="",
|
@@ -87,16 +87,16 @@ class MiniGPT4(Blip2Base):
|
|
87 |
print('Loading Q-Former Done')
|
88 |
|
89 |
print('Loading LLAMA')
|
90 |
-
self.llama_tokenizer = LlamaTokenizer.from_pretrained('/
|
91 |
self.llama_tokenizer.pad_token = self.llama_tokenizer.eos_token
|
92 |
|
93 |
if llama_cache_dir:
|
94 |
self.llama_model = LlamaForCausalLM.from_pretrained(
|
95 |
-
'/
|
96 |
)
|
97 |
else:
|
98 |
self.llama_model = LlamaForCausalLM.from_pretrained(
|
99 |
-
'/
|
100 |
)
|
101 |
for name, param in self.llama_model.named_parameters():
|
102 |
param.requires_grad = False
|
|
|
38 |
freeze_vit=True,
|
39 |
freeze_qformer=True,
|
40 |
num_query_token=32,
|
41 |
+
llama_model="",
|
42 |
llama_cache_dir='',
|
43 |
prompt_path="",
|
44 |
prompt_template="",
|
|
|
87 |
print('Loading Q-Former Done')
|
88 |
|
89 |
print('Loading LLAMA')
|
90 |
+
self.llama_tokenizer = LlamaTokenizer.from_pretrained('Vision-CAIR/vicuna-7b', use_fast=False, use_auth_token=True)
|
91 |
self.llama_tokenizer.pad_token = self.llama_tokenizer.eos_token
|
92 |
|
93 |
if llama_cache_dir:
|
94 |
self.llama_model = LlamaForCausalLM.from_pretrained(
|
95 |
+
'Vision-CAIR/vicuna-7b', load_in_4bit=True, torch_dtype=torch.float16, device_map="auto", use_auth_token=True
|
96 |
)
|
97 |
else:
|
98 |
self.llama_model = LlamaForCausalLM.from_pretrained(
|
99 |
+
'Vision-CAIR/vicuna-7b', load_in_4bit=True, torch_dtype=torch.float16, device_map="auto", use_auth_token=True
|
100 |
)
|
101 |
for name, param in self.llama_model.named_parameters():
|
102 |
param.requires_grad = False
|