Spaces:
Runtime error
Runtime error
Update maira2Service.py
Browse files- maira2Service.py +5 -0
maira2Service.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
| 2 |
from pathlib import Path
|
| 3 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
model = AutoModelForCausalLM.from_pretrained("microsoft/maira-2", trust_remote_code=True)
|
| 6 |
processor = AutoProcessor.from_pretrained("microsoft/maira-2", trust_remote_code=True)
|
|
|
|
| 1 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
| 2 |
from pathlib import Path
|
| 3 |
import torch
|
| 4 |
+
import os
|
| 5 |
+
from huggingface_hub import login
|
| 6 |
+
|
| 7 |
+
HF_TOKEN=os.getenv('HF_TOKEN')
|
| 8 |
+
login(HF_TOKEN)
|
| 9 |
|
| 10 |
model = AutoModelForCausalLM.from_pretrained("microsoft/maira-2", trust_remote_code=True)
|
| 11 |
processor = AutoProcessor.from_pretrained("microsoft/maira-2", trust_remote_code=True)
|