Spaces:
Runtime error
Runtime error
Update utils/florencegpu1.py
Browse files- utils/florencegpu1.py +2 -2
utils/florencegpu1.py
CHANGED
@@ -30,8 +30,8 @@ def load_florence_model(
|
|
30 |
) -> Tuple[Any, Any]:
|
31 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
32 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
33 |
-
model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-
|
34 |
-
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-
|
35 |
return model, processor
|
36 |
|
37 |
|
|
|
30 |
) -> Tuple[Any, Any]:
|
31 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
32 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
33 |
+
model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-large", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
|
34 |
+
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-large", trust_remote_code=True)
|
35 |
return model, processor
|
36 |
|
37 |
|