Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import importlib.util
|
|
| 5 |
import gradio as gr
|
| 6 |
from rich import _console
|
| 7 |
from transformers import AutoModel, AutoTokenizer, AutoConfig, pipeline
|
| 8 |
-
|
| 9 |
from huggingface_hub import snapshot_download
|
| 10 |
import sys, pathlib
|
| 11 |
import os
|
|
@@ -13,6 +13,17 @@ os.environ["OPENAI_API_KEY"] = "test"
|
|
| 13 |
os.environ["OMP_NUM_THREADS"] = "4"
|
| 14 |
|
| 15 |
print("All imports finished")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# # 1) Download the repo to a local cache dir
|
| 18 |
# print("Downloading remote vine repo...")
|
|
@@ -89,6 +100,8 @@ def process_video(video_file, categorical_keywords, unary_keywords, binary_keywo
|
|
| 89 |
import traceback
|
| 90 |
traceback.print_exc()
|
| 91 |
raise
|
|
|
|
|
|
|
| 92 |
categorical_keywords = [kw.strip() for kw in categorical_keywords.split(",")] if categorical_keywords else []
|
| 93 |
unary_keywords = [kw.strip() for kw in unary_keywords.split(",")] if unary_keywords else []
|
| 94 |
binary_keywords = [kw.strip() for kw in binary_keywords.split(",")] if binary_keywords else []
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
from rich import _console
|
| 7 |
from transformers import AutoModel, AutoTokenizer, AutoConfig, pipeline
|
| 8 |
+
import torch
|
| 9 |
from huggingface_hub import snapshot_download
|
| 10 |
import sys, pathlib
|
| 11 |
import os
|
|
|
|
| 13 |
os.environ["OMP_NUM_THREADS"] = "4"
|
| 14 |
|
| 15 |
print("All imports finished")
|
| 16 |
+
print(f"Python version: {sys.version}")
|
| 17 |
+
print(f"PyTorch version: {torch.__version__}")
|
| 18 |
+
print(f"CUDA available: {torch.cuda.is_available()}")
|
| 19 |
+
print(f"CUDA version: {torch.version.cuda}")
|
| 20 |
+
print(f"cuDNN version: {torch.backends.cudnn.version()}")
|
| 21 |
+
print(f"Number of GPUs: {torch.cuda.device_count()}")
|
| 22 |
+
|
| 23 |
+
if torch.cuda.is_available():
|
| 24 |
+
for i in range(torch.cuda.device_count()):
|
| 25 |
+
print(f"GPU {i}: {torch.cuda.get_device_name(i)}")
|
| 26 |
+
print(f" Memory: {torch.cuda.get_device_properties(i).total_memory / 1e9:.2f} GB")
|
| 27 |
|
| 28 |
# # 1) Download the repo to a local cache dir
|
| 29 |
# print("Downloading remote vine repo...")
|
|
|
|
| 100 |
import traceback
|
| 101 |
traceback.print_exc()
|
| 102 |
raise
|
| 103 |
+
|
| 104 |
+
|
| 105 |
categorical_keywords = [kw.strip() for kw in categorical_keywords.split(",")] if categorical_keywords else []
|
| 106 |
unary_keywords = [kw.strip() for kw in unary_keywords.split(",")] if unary_keywords else []
|
| 107 |
binary_keywords = [kw.strip() for kw in binary_keywords.split(",")] if binary_keywords else []
|