Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,14 @@ from transformers import AutoModel
|
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
import os
|
|
|
|
| 6 |
|
| 7 |
MODEL_ACCESS_TOKEN = os.getenv('MODEL_ACCESS_TOKEN')
|
| 8 |
|
|
|
|
|
|
|
| 9 |
# Load the model
|
| 10 |
-
model = AutoModel.from_pretrained("jcsagar/CXR-LLAVA-v2", trust_remote_code=True
|
| 11 |
model = model.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 12 |
|
| 13 |
# Define the function to generate the report
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
import os
|
| 6 |
+
from huggingface_hub import login
|
| 7 |
|
| 8 |
MODEL_ACCESS_TOKEN = os.getenv('MODEL_ACCESS_TOKEN')
|
| 9 |
|
| 10 |
+
login(MODEL_ACCESS_TOKEN)
|
| 11 |
+
|
| 12 |
# Load the model
|
| 13 |
+
model = AutoModel.from_pretrained("jcsagar/CXR-LLAVA-v2", trust_remote_code=True)
|
| 14 |
model = model.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 15 |
|
| 16 |
# Define the function to generate the report
|