Fix Kaggle telemetry detection & address review feedback
- Fix Kaggle misclassification by prioritizing filesystem markers over env vars - Preserve telemetry pings when statistics is explicitly provided - Replace bare except with except Exception - Minor cleanup based on automated review feedback
This commit is contained in:
parent
7b7287c9b9
commit
93cf0ee805
1 changed files with 3 additions and 7 deletions
|
|
@ -1106,9 +1106,7 @@ def _get_statistics(statistics = None, force_download = True):
|
|||
global USE_MODELSCOPE
|
||||
USE_MODELSCOPE = os.environ.get("UNSLOTH_USE_MODELSCOPE", "0") == "1"
|
||||
|
||||
if statistics is not None:
|
||||
pass
|
||||
else:
|
||||
if statistics is None:
|
||||
# Prefer filesystem markers (harder to misidentify) before env-key matching
|
||||
try:
|
||||
from pathlib import Path
|
||||
|
|
@ -1150,7 +1148,6 @@ def _get_statistics(statistics = None, force_download = True):
|
|||
"/sys/class/dmi/id/chassis_asset_tag",
|
||||
"/sys/class/dmi/id/sys_vendor",
|
||||
)
|
||||
from pathlib import Path
|
||||
|
||||
for vendor_file in vendor_files:
|
||||
path = Path(vendor_file)
|
||||
|
|
@ -1163,11 +1160,10 @@ def _get_statistics(statistics = None, force_download = True):
|
|||
elif "google" in file_content:
|
||||
return "gcp"
|
||||
return "other"
|
||||
|
||||
pass
|
||||
|
||||
try:
|
||||
statistics = try_vllm_check()
|
||||
except:
|
||||
except Exception:
|
||||
statistics = "other"
|
||||
|
||||
if statistics is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue