Mer0vin8ian
/

Mer0vin8ian commited on
Commit
3245dbb
·
verified ·
1 Parent(s): 3140ff4

Upload scripts/compile_qwen3_5_9b.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/compile_qwen3_5_9b.py +8 -2
scripts/compile_qwen3_5_9b.py CHANGED
@@ -108,10 +108,16 @@ import qai_hub as hub
108
  from huggingface_hub import login, HfApi
109
 
110
  login(token=HF_TOKEN)
 
 
 
 
 
 
 
 
111
  if hasattr(hub, "configure"):
112
  hub.configure(api_token=QAI_TOKEN)
113
- else:
114
- os.environ.setdefault("QAI_HUB_API_TOKEN", QAI_TOKEN)
115
 
116
 
117
  # ── helpers ────────────────────────────────────────────────────────────────────────
 
108
  from huggingface_hub import login, HfApi
109
 
110
  login(token=HF_TOKEN)
111
+ os.environ["QAI_HUB_API_TOKEN"] = QAI_TOKEN
112
+ cfg_dir = os.path.expanduser("~/.qai_hub")
113
+ cfg_file = os.path.join(cfg_dir, "client.ini")
114
+ if not os.path.exists(cfg_file):
115
+ os.makedirs(cfg_dir, exist_ok=True)
116
+ with open(cfg_file, "w") as f:
117
+ f.write(f"[api]\napi_token = {QAI_TOKEN}\n")
118
+ print(f" wrote {cfg_file}")
119
  if hasattr(hub, "configure"):
120
  hub.configure(api_token=QAI_TOKEN)
 
 
121
 
122
 
123
  # ── helpers ────────────────────────────────────────────────────────────────────────