Spaces:
Paused
Paused
Commit ·
fbf8187
1
Parent(s): b4a2158
Capture and display exact Unsloth import exception
Browse files
cloud_arena/llm_training.py
CHANGED
|
@@ -19,9 +19,12 @@ matplotlib.use("Agg")
|
|
| 19 |
warnings.filterwarnings("ignore", category=UserWarning)
|
| 20 |
warnings.filterwarnings("ignore", category=FutureWarning)
|
| 21 |
|
|
|
|
|
|
|
| 22 |
try:
|
| 23 |
from unsloth import FastLanguageModel
|
| 24 |
-
except Exception:
|
|
|
|
| 25 |
FastLanguageModel = None
|
| 26 |
|
| 27 |
|
|
@@ -122,8 +125,8 @@ def _load_with_unsloth(model_name, hf_token):
|
|
| 122 |
"""
|
| 123 |
if FastLanguageModel is None:
|
| 124 |
raise RuntimeError(
|
| 125 |
-
"Unsloth is required for hackathon compliance but is unavailable. "
|
| 126 |
-
"Install/import unsloth and retry."
|
| 127 |
)
|
| 128 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 129 |
model_name=model_name,
|
|
|
|
| 19 |
warnings.filterwarnings("ignore", category=UserWarning)
|
| 20 |
warnings.filterwarnings("ignore", category=FutureWarning)
|
| 21 |
|
| 22 |
+
import traceback
|
| 23 |
+
import_error_msg = ""
|
| 24 |
try:
|
| 25 |
from unsloth import FastLanguageModel
|
| 26 |
+
except Exception as e:
|
| 27 |
+
import_error_msg = f"{e}\n{traceback.format_exc()}"
|
| 28 |
FastLanguageModel = None
|
| 29 |
|
| 30 |
|
|
|
|
| 125 |
"""
|
| 126 |
if FastLanguageModel is None:
|
| 127 |
raise RuntimeError(
|
| 128 |
+
f"Unsloth is required for hackathon compliance but is unavailable. "
|
| 129 |
+
f"Install/import unsloth and retry.\nDetails:\n{import_error_msg}"
|
| 130 |
)
|
| 131 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 132 |
model_name=model_name,
|