Add GPU debug logging
Browse files
app.py
CHANGED
|
@@ -17,9 +17,24 @@ try:
|
|
| 17 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 18 |
from peft import PeftModel
|
| 19 |
GPU_AVAILABLE = torch.cuda.is_available()
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
GPU_AVAILABLE = False
|
| 22 |
-
print("Warning:
|
|
|
|
| 23 |
|
| 24 |
# ============================================================
|
| 25 |
# 모델 레지스트리 (HF Hub 경로)
|
|
|
|
| 17 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 18 |
from peft import PeftModel
|
| 19 |
GPU_AVAILABLE = torch.cuda.is_available()
|
| 20 |
+
|
| 21 |
+
# Debug info
|
| 22 |
+
print("=" * 50)
|
| 23 |
+
print(f"PyTorch version: {torch.__version__}")
|
| 24 |
+
print(f"CUDA available: {torch.cuda.is_available()}")
|
| 25 |
+
if torch.cuda.is_available():
|
| 26 |
+
print(f"CUDA version: {torch.version.cuda}")
|
| 27 |
+
print(f"GPU count: {torch.cuda.device_count()}")
|
| 28 |
+
print(f"GPU name: {torch.cuda.get_device_name(0)}")
|
| 29 |
+
else:
|
| 30 |
+
print("CUDA not available - checking why...")
|
| 31 |
+
print(f"torch.backends.cudnn.enabled: {torch.backends.cudnn.enabled if hasattr(torch.backends, 'cudnn') else 'N/A'}")
|
| 32 |
+
print("=" * 50)
|
| 33 |
+
|
| 34 |
+
except ImportError as e:
|
| 35 |
GPU_AVAILABLE = False
|
| 36 |
+
print(f"Warning: Import error - {e}")
|
| 37 |
+
print("Running in mock mode")
|
| 38 |
|
| 39 |
# ============================================================
|
| 40 |
# 모델 레지스트리 (HF Hub 경로)
|