Proteinrequired commited on
Commit
b7c6983
·
verified ·
1 Parent(s): e3daf47

Update train.py

Browse files
Files changed (1) hide show
  1. train.py +17 -0
train.py CHANGED
@@ -1,3 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  # ==========================================
3
  # 1. THE STABLE ENVIRONMENT INSTALL
 
1
+ # ==========================================
2
+ # 0. SIMPLE AUTHENTICATION (FOR GATED MODEL)
3
+ # ==========================================
4
+ import os
5
+ import sys
6
+ from huggingface_hub import login
7
+
8
+ # Grab the secret you set in the HF Space UI
9
+ hf_token = os.environ.get("HF_TOKEN")
10
+
11
+ if not hf_token:
12
+ print("❌ ERROR: HF_TOKEN not found in Secrets. Llama-3.2 download will fail.")
13
+ sys.exit(1)
14
+
15
+ # Silently log in so Unsloth can download the gated weights
16
+ login(token=hf_token.strip())
17
+ print("✅ Authenticated. Ready to load Llama-3.2.")
18
 
19
  # ==========================================
20
  # 1. THE STABLE ENVIRONMENT INSTALL