Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,23 @@ import gradio as gr
|
|
16 |
import torch
|
17 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
# ---------------------------
|
20 |
# Config & Secrets
|
21 |
# ---------------------------
|
|
|
16 |
import torch
|
17 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
18 |
|
19 |
+
def _print_runtime_env():
|
20 |
+
import platform, torch, os
|
21 |
+
print("======== RUNTIME ========")
|
22 |
+
print("Python:", platform.python_version())
|
23 |
+
print("PyTorch:", torch.__version__)
|
24 |
+
print("CUDA available:", torch.cuda.is_available())
|
25 |
+
if torch.cuda.is_available():
|
26 |
+
print("CUDA device count:", torch.cuda.device_count())
|
27 |
+
print("CUDA device name:", torch.cuda.get_device_name(0))
|
28 |
+
print("torch.version.cuda:", getattr(torch.version, "cuda", None))
|
29 |
+
print("MPS available (Apple):", torch.backends.mps.is_available() if hasattr(torch.backends, "mps") else False)
|
30 |
+
print("HF_HOME:", os.getenv("HF_HOME"))
|
31 |
+
print("=========================")
|
32 |
+
|
33 |
+
_print_runtime_env()
|
34 |
+
|
35 |
+
|
36 |
# ---------------------------
|
37 |
# Config & Secrets
|
38 |
# ---------------------------
|