Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -43,18 +43,13 @@ processor = AutoProcessor.from_pretrained(
|
|
| 43 |
"microsoft/Florence-2-base", trust_remote_code=True
|
| 44 |
)
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 54 |
-
"weights/icon_caption_florence",
|
| 55 |
-
torch_dtype=torch.float16,
|
| 56 |
-
trust_remote_code=True,
|
| 57 |
-
)
|
| 58 |
caption_model_processor = {"processor": processor, "model": model}
|
| 59 |
print("finish loading model!!!")
|
| 60 |
|
|
|
|
| 43 |
"microsoft/Florence-2-base", trust_remote_code=True
|
| 44 |
)
|
| 45 |
|
| 46 |
+
|
| 47 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 48 |
+
"weights/icon_caption_florence",
|
| 49 |
+
torch_dtype=torch.float16,
|
| 50 |
+
trust_remote_code=True,
|
| 51 |
+
device_map='auto',
|
| 52 |
+
).to("cuda")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
caption_model_processor = {"processor": processor, "model": model}
|
| 54 |
print("finish loading model!!!")
|
| 55 |
|