Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -897,11 +897,11 @@ REMEMBER: One tool per turn. No reasoning without tools. Exact answer format.
|
|
| 897 |
print("Initializing Groq LLM...")
|
| 898 |
try:
|
| 899 |
#. Initialize the LLM ()
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
# Use tool_choice="any" to FORCE tool usage
|
| 906 |
# self.llm_with_tools = ChatGroq(
|
| 907 |
# temperature=0,
|
|
@@ -909,8 +909,8 @@ REMEMBER: One tool per turn. No reasoning without tools. Exact answer format.
|
|
| 909 |
# model_name="llama-3.3-70b-versatile",
|
| 910 |
# max_tokens=4096,
|
| 911 |
#timeout=60
|
| 912 |
-
|
| 913 |
-
|
| 914 |
|
| 915 |
except Exception as e:
|
| 916 |
print(f"❌ Error initializing HuggingFace: {e}")
|
|
|
|
| 897 |
print("Initializing Groq LLM...")
|
| 898 |
try:
|
| 899 |
#. Initialize the LLM ()
|
| 900 |
+
self.llm_with_tools = HuggingFaceEndpoint(
|
| 901 |
+
repo_id="HuggingFaceH4/zephyr-7b-beta", # Changed model
|
| 902 |
+
huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
| 903 |
+
max_new_tokens=2048, # Increased token limit for potentially longer reasoning/tool use
|
| 904 |
+
temperature=0.01, # Keep temperature low for factual tasks
|
| 905 |
# Use tool_choice="any" to FORCE tool usage
|
| 906 |
# self.llm_with_tools = ChatGroq(
|
| 907 |
# temperature=0,
|
|
|
|
| 909 |
# model_name="llama-3.3-70b-versatile",
|
| 910 |
# max_tokens=4096,
|
| 911 |
#timeout=60
|
| 912 |
+
).bind_tools(self.tools, tool_choice="auto") # FORCE tool calls
|
| 913 |
+
print("✅ LLM initialized with FORCED tool usage.")
|
| 914 |
|
| 915 |
except Exception as e:
|
| 916 |
print(f"❌ Error initializing HuggingFace: {e}")
|