Spaces:
Runtime error
Runtime error
ShreyMehra
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,8 @@ class Model:
|
|
58 |
config = PeftConfig.from_pretrained(peft_model_id)
|
59 |
global model
|
60 |
global processor
|
61 |
-
model = Blip2ForConditionalGeneration.from_pretrained(config.base_model_name_or_path, low_cpu_mem_usage=True) #, device_map="auto", load_in_8bit=True
|
|
|
62 |
model = PeftModel.from_pretrained(model, peft_model_id)
|
63 |
processor = AutoProcessor.from_pretrained("Salesforce/blip2-opt-2.7b")
|
64 |
|
|
|
58 |
config = PeftConfig.from_pretrained(peft_model_id)
|
59 |
global model
|
60 |
global processor
|
61 |
+
model = Blip2ForConditionalGeneration.from_pretrained(config.base_model_name_or_path, low_cpu_mem_usage=True, torch_dtype=torch.float16) #, device_map="auto", load_in_8bit=True
|
62 |
+
model.params = model.to_fp32(model.params)
|
63 |
model = PeftModel.from_pretrained(model, peft_model_id)
|
64 |
processor = AutoProcessor.from_pretrained("Salesforce/blip2-opt-2.7b")
|
65 |
|