Spaces:
Build error
Build error
Wisdom Chen
commited on
Update model.py
Browse filesModify the initialize function
model.py
CHANGED
@@ -58,6 +58,8 @@ def initialize_models() -> bool:
|
|
58 |
clip_model, _, clip_preprocess = open_clip.create_model_and_transforms(
|
59 |
'hf-hub:Marqo/marqo-fashionCLIP'
|
60 |
)
|
|
|
|
|
61 |
clip_model = clip_model.to(device)
|
62 |
clip_model.eval()
|
63 |
clip_tokenizer = open_clip.get_tokenizer('hf-hub:Marqo/marqo-fashionCLIP')
|
|
|
58 |
clip_model, _, clip_preprocess = open_clip.create_model_and_transforms(
|
59 |
'hf-hub:Marqo/marqo-fashionCLIP'
|
60 |
)
|
61 |
+
# Use to_empty() first, then move to device
|
62 |
+
clip_model = clip_model.to_empty(device=device)
|
63 |
clip_model = clip_model.to(device)
|
64 |
clip_model.eval()
|
65 |
clip_tokenizer = open_clip.get_tokenizer('hf-hub:Marqo/marqo-fashionCLIP')
|