Spaces:
Runtime error
Runtime error
Update launch.py
Browse files
launch.py
CHANGED
@@ -34,7 +34,7 @@ lm_model = LlamaForCausalLM.from_pretrained(
|
|
34 |
torch_dtype=torch.float16,
|
35 |
use_auth_token=AUTH_TOKEN,
|
36 |
quantization_config=BitsAndBytesConfig(load_in_8bit=True))
|
37 |
-
tokenizer = LlamaTokenizer.from_pretrained(LM_MODEL_PATH)
|
38 |
|
39 |
# visual model
|
40 |
OPENAI_CLIP_MEAN = [0.48145466, 0.4578275, 0.40821073]
|
@@ -42,7 +42,7 @@ OPENAI_CLIP_STD = [0.26862954, 0.26130258, 0.27577711]
|
|
42 |
# demo.py is in the project path, so we can use local path ".". Otherwise you should use "IDEA-CCNL/Ziya-BLIP2-14B-Visual-v1"
|
43 |
model = AutoModelForCausalLM.from_pretrained(
|
44 |
"IDEA-CCNL/Ziya-BLIP2-14B-Visual-v1",
|
45 |
-
trust_remote_code=True,
|
46 |
torch_dtype=torch.float16)
|
47 |
model.cuda() # if you use on cpu, comment this line
|
48 |
model.language_model = lm_model
|
|
|
34 |
torch_dtype=torch.float16,
|
35 |
use_auth_token=AUTH_TOKEN,
|
36 |
quantization_config=BitsAndBytesConfig(load_in_8bit=True))
|
37 |
+
tokenizer = LlamaTokenizer.from_pretrained(LM_MODEL_PATH, use_auth_token=AUTH_TOKEN)
|
38 |
|
39 |
# visual model
|
40 |
OPENAI_CLIP_MEAN = [0.48145466, 0.4578275, 0.40821073]
|
|
|
42 |
# demo.py is in the project path, so we can use local path ".". Otherwise you should use "IDEA-CCNL/Ziya-BLIP2-14B-Visual-v1"
|
43 |
model = AutoModelForCausalLM.from_pretrained(
|
44 |
"IDEA-CCNL/Ziya-BLIP2-14B-Visual-v1",
|
45 |
+
trust_remote_code=True, use_auth_token=AUTH_TOKEN,
|
46 |
torch_dtype=torch.float16)
|
47 |
model.cuda() # if you use on cpu, comment this line
|
48 |
model.language_model = lm_model
|