Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Optional, Dict, Any
|
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import numpy as np
|
| 9 |
-
from open_clip import create_model_and_transforms
|
| 10 |
from huggingface_hub import snapshot_download
|
| 11 |
from PIL import Image
|
| 12 |
import requests
|
|
@@ -60,7 +60,6 @@ repo_dir = snapshot_download(MODEL_NAME, revision=MODEL_REVISION)
|
|
| 60 |
repo_dir = str(Path(repo_dir).resolve())
|
| 61 |
model, _, preprocess = create_model_and_transforms(f"local-dir:{repo_dir}")
|
| 62 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 63 |
-
tokenizer = get_tokenizer(f"local-dir:{repo_dir}")
|
| 64 |
model = model.to(device)
|
| 65 |
logger.info(f"Model loaded on device successfully: {device}")
|
| 66 |
|
|
|
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import numpy as np
|
| 9 |
+
from open_clip import create_model_and_transforms
|
| 10 |
from huggingface_hub import snapshot_download
|
| 11 |
from PIL import Image
|
| 12 |
import requests
|
|
|
|
| 60 |
repo_dir = str(Path(repo_dir).resolve())
|
| 61 |
model, _, preprocess = create_model_and_transforms(f"local-dir:{repo_dir}")
|
| 62 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 63 |
model = model.to(device)
|
| 64 |
logger.info(f"Model loaded on device successfully: {device}")
|
| 65 |
|