Spaces:
Running
on
Zero
Running
on
Zero
gokaygokay
commited on
Commit
•
0c2f001
1
Parent(s):
0d0f39a
Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,8 @@ huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
|
18 |
|
19 |
# Initialize Florence model
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
-
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-
|
22 |
-
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-
|
23 |
|
24 |
# Florence caption function
|
25 |
@spaces.GPU
|
|
|
18 |
|
19 |
# Initialize Florence model
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
+
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to(device).eval()
|
22 |
+
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
|
23 |
|
24 |
# Florence caption function
|
25 |
@spaces.GPU
|