Spaces:
Sleeping
Sleeping
feat: add conditional logic to switch between local ChatOllama and remote HuggingFaceEndpoint models
Browse files31 unmodified lines32333435363738394041424344454631 unmodified lines# --- Basic Agent Definition ---# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------# llm = HuggingFaceEndpoint(# repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct",# huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN")# )llm = ChatOllama(model="gemma4:31b",temperature=0,)system_prompt = """You are an AI assistant taking the GAIA benchmark. You must output ONLY the final answer. Do not include any explanations, conversational text or formatting. If the answer is a number, output just the number. If it is a list, output a comma-separated list."""31 unmodified lines323334353637383940414243444546474831 unmodified lines# --- Basic Agent Definition ---# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------if IS_LOCAL:llm = ChatOllama(model="gemma4:31b",temperature=0,)else:# When on Hugging Face, use a remote endpointllm = HuggingFaceEndpoint(repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct",huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"))system_prompt = """You are an AI assistant taking the GAIA benchmark. You must output ONLY the final answer. Do not include any explanations, conversational text or formatting. If the answer is a number, output just the number. If it is a list, output a comma-separated list."""
app.py+11-9