jcsagar commited on
Commit
03728a5
·
verified ·
1 Parent(s): de198e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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, token=MODEL_ACCESS_TOKEN)
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