Spaces:
Sleeping
Sleeping
feat: wrap HuggingFaceEndpoint in ChatHuggingFace to enable tool support
Browse files
app.py
CHANGED
|
@@ -38,11 +38,12 @@ if IS_LOCAL:
|
|
| 38 |
temperature=0,
|
| 39 |
)
|
| 40 |
else:
|
| 41 |
-
# When on Hugging Face, use a remote endpoint
|
| 42 |
-
|
| 43 |
repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 44 |
huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
| 45 |
)
|
|
|
|
| 46 |
|
| 47 |
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."""
|
| 48 |
|
|
|
|
| 38 |
temperature=0,
|
| 39 |
)
|
| 40 |
else:
|
| 41 |
+
# When on Hugging Face, use a remote endpoint wrapped in ChatHuggingFace for tool support
|
| 42 |
+
llm_base = HuggingFaceEndpoint(
|
| 43 |
repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 44 |
huggingfacehub_api_token=os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
| 45 |
)
|
| 46 |
+
llm = ChatHuggingFace(llm=llm_base)
|
| 47 |
|
| 48 |
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."""
|
| 49 |
|