Spaces:
Running
on
Zero
Running
on
Zero
correct model loading logic
Browse files- app.py +1 -1
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/README.md +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/adapter_config.json +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/adapter_model.bin +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/config.json +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/latest +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/non_lora_trainables.bin +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_0.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_1.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_10.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_11.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_2.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_3.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_4.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_5.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_6.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_7.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_8.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_9.pth +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/special_tokens_map.json +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/tokenizer.model +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/tokenizer_config.json +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/trainer_state.json +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/training_args.bin +0 -0
- checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/zero_to_fp32.py +0 -0
- llava/model/builder.py +1 -1
app.py
CHANGED
@@ -26,7 +26,7 @@ from session import Session
|
|
26 |
from model import load_model_and_dataloader, get_model_response
|
27 |
|
28 |
# Load model and tokenizer once at the start
|
29 |
-
model_path = "checkpoints/
|
30 |
model_base = "checkpoints/llava-llama-2-7b-chat-lightning-preview"
|
31 |
load_8bit = False
|
32 |
load_4bit = False
|
|
|
26 |
from model import load_model_and_dataloader, get_model_response
|
27 |
|
28 |
# Load model and tokenizer once at the start
|
29 |
+
model_path = "checkpoints/llava_lora_grounded_obj_ref_checkpoint-4896"
|
30 |
model_base = "checkpoints/llava-llama-2-7b-chat-lightning-preview"
|
31 |
load_8bit = False
|
32 |
load_4bit = False
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/README.md
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/adapter_config.json
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/adapter_model.bin
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/config.json
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/latest
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/non_lora_trainables.bin
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_0.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_1.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_10.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_11.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_2.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_3.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_4.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_5.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_6.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_7.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_8.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/rng_state_9.pth
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/special_tokens_map.json
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/tokenizer.model
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/tokenizer_config.json
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/trainer_state.json
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/training_args.bin
RENAMED
File without changes
|
checkpoints/{lora_grounded_obj_ref_checkpoint-4896 β llava_lora_grounded_obj_ref_checkpoint-4896}/zero_to_fp32.py
RENAMED
File without changes
|
llava/model/builder.py
CHANGED
@@ -197,7 +197,7 @@ def load_pretrained_model(
|
|
197 |
model_base,
|
198 |
torch_dtype=torch.bfloat16,
|
199 |
low_cpu_mem_usage=True,
|
200 |
-
device_map=
|
201 |
)
|
202 |
print(f"Loading LoRA weights from {model_path}")
|
203 |
model = PeftModel.from_pretrained(model, model_path)
|
|
|
197 |
model_base,
|
198 |
torch_dtype=torch.bfloat16,
|
199 |
low_cpu_mem_usage=True,
|
200 |
+
device_map=device_map,
|
201 |
)
|
202 |
print(f"Loading LoRA weights from {model_path}")
|
203 |
model = PeftModel.from_pretrained(model, model_path)
|