Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files734 unmodified lines735736737738739738739740273 unmodified lines101410151016101910171018101945 unmodified lines1065106610671071106810691070107110751072107310741075140 unmodified lines1216121712181222122312191220122112221223734 unmodified lines "huggingface/meta-llama/Llama-3.1-8B-Instruct", ])
self.working_models = candidate_models
if self.provider_keys.get("openrouter"): candidate_models = [ "openrouter/moonshotai/kimi-k2:free",273 unmodified lines if m not in blocked_models and not (m.startswith("openrouter/") and not self.provider_keys.get("openrouter")) ] models_to_try.sort(key=lambda m: (1 if m.startswith("gemini/") else 0))
for model_name in models_to_try: if not hasattr(self, "_build_model") or not hasattr(self, "agent"):45 unmodified lines return f"Error initializing agent: {e}", None # In the case of an app running as a hugging Face space, this link points toward your codebase ( usefull for others so please keep it public) agent_code = ( f"[https://huggingface.co/spaces/](https://huggingface.co/spaces/){space_id}/tree/main" f"https://huggingface.co/spaces/{space_id}/tree/main" if space_id else ( os.getenv("AGENT_CODE_URL") or f"[https://huggingface.co/spaces/](https://huggingface.co/spaces/){username.strip()}/Final_Assignment_Template/tree/main" or f"https://huggingface.co/spaces/{username.strip()}/Final_Assignment_Template/tree/main" ).strip() ) print(agent_code)140 unmodified lines
if space_id_startup: # Print repo URLs if SPACE_ID is found print(f"✅ SPACE_ID found: {space_id_startup}") print(f" Repo URL: [https://huggingface.co/spaces/](https://huggingface.co/spaces/){space_id_startup}") print(f" Repo Tree URL: [https://huggingface.co/spaces/](https://huggingface.co/spaces/){space_id_startup}/tree/main") print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}") print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main") else: print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
app.py+4-7