Spaces:
Runtime error
Runtime error
Update app.py
Browse filesFEAT: add hf_token
app.py
CHANGED
@@ -8,9 +8,10 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
8 |
|
9 |
|
10 |
_MODEL_PATH = 'IDEA-CCNL/Taiyi-BLIP-750M-Chinese'
|
11 |
-
|
12 |
-
processor = BlipProcessor.from_pretrained(_MODEL_PATH)
|
13 |
-
model = BlipForConditionalGeneration.from_pretrained(
|
|
|
14 |
|
15 |
|
16 |
def inference(raw_image, model_n, question, strategy):
|
|
|
8 |
|
9 |
|
10 |
_MODEL_PATH = 'IDEA-CCNL/Taiyi-BLIP-750M-Chinese'
|
11 |
+
HF_TOKEN = os.getenv('HF_TOKEN')
|
12 |
+
processor = BlipProcessor.from_pretrained(_MODEL_PATH, use_auth_token=HF_TOKEN)
|
13 |
+
model = BlipForConditionalGeneration.from_pretrained(
|
14 |
+
_MODEL_PATH, use_auth_token=HF_TOKEN).half().eval().to(device)
|
15 |
|
16 |
|
17 |
def inference(raw_image, model_n, question, strategy):
|