Spaces:
Runtime error
Runtime error
Commit
·
d867e19
1
Parent(s):
bc83b1f
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,10 @@ def caption_image(model_choice, image_input, url_input, load_in_8bit):
|
|
31 |
captioner = pipeline(task="image-to-text",
|
32 |
model=CAPTION_MODELS[model_choice],
|
33 |
max_new_tokens=30,
|
34 |
-
|
|
|
|
|
|
|
35 |
)
|
36 |
# Store the loaded model
|
37 |
loaded_models[model_key] = captioner
|
|
|
31 |
captioner = pipeline(task="image-to-text",
|
32 |
model=CAPTION_MODELS[model_choice],
|
33 |
max_new_tokens=30,
|
34 |
+
device=0, # Set the device as CPU
|
35 |
+
model_kwargs=model_kwargs,
|
36 |
+
torch_dtype=torch.float16, # Set the floating point to Float16
|
37 |
+
use_fast=True
|
38 |
)
|
39 |
# Store the loaded model
|
40 |
loaded_models[model_key] = captioner
|