Spaces:
Runtime error
Runtime error
acecalisto3
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,9 @@ import faiss
|
|
24 |
import numpy as np
|
25 |
from PIL import Image
|
26 |
|
|
|
|
|
|
|
27 |
# Configure logging
|
28 |
logging.basicConfig(
|
29 |
level=logging.INFO,
|
@@ -200,9 +203,11 @@ class ModelManager:
|
|
200 |
"image_processor": {
|
201 |
"model_id": "Salesforce/blip-image-captioning-base",
|
202 |
"processor": AutoProcessor,
|
203 |
-
"model": AutoModel
|
204 |
"kwargs": {
|
205 |
-
"cache_dir": str(cache_dir)
|
|
|
|
|
206 |
}
|
207 |
}
|
208 |
}
|
|
|
24 |
import numpy as np
|
25 |
from PIL import Image
|
26 |
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
# Configure logging
|
31 |
logging.basicConfig(
|
32 |
level=logging.INFO,
|
|
|
203 |
"image_processor": {
|
204 |
"model_id": "Salesforce/blip-image-captioning-base",
|
205 |
"processor": AutoProcessor,
|
206 |
+
"model": BlipForConditionalGeneration, # Changed from AutoModel
|
207 |
"kwargs": {
|
208 |
+
"cache_dir": str(cache_dir),
|
209 |
+
"device_map": "auto" # Add device mapping
|
210 |
+
}
|
211 |
}
|
212 |
}
|
213 |
}
|