Spaces:
Running
on
Zero
Running
on
Zero
gokaygokay
commited on
Commit
•
66eb2a5
1
Parent(s):
9f4b6f2
Update caption_models.py
Browse files- caption_models.py +2 -0
caption_models.py
CHANGED
@@ -13,6 +13,8 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
|
|
13 |
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
|
|
|
|
|
16 |
# Initialize Florence model
|
17 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to(device).eval()
|
18 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
|
|
|
13 |
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
|
16 |
+
HF_TOKEN = os.getenv("HUGGINGFACE_TOKEN", None)
|
17 |
+
|
18 |
# Initialize Florence model
|
19 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to(device).eval()
|
20 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
|