Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -227,12 +227,12 @@ class HfAgentWrapper:
|
|
227 |
print(f"Prepared Tool objects with names: {[tool.name for tool in self.actual_tools_for_agent]}")
|
228 |
|
229 |
# --- Step 3: Pass the PRE-INITIALIZED pipeline object to HfAgent ---
|
230 |
-
print("Initializing
|
231 |
-
self.agent =
|
232 |
-
llm_pipeline,
|
233 |
additional_tools=self.actual_tools_for_agent
|
234 |
)
|
235 |
-
print("
|
236 |
|
237 |
except Exception as e:
|
238 |
print(f"CRITICAL ERROR: Failed to initialize HfAgent or Pipeline: {e}")
|
|
|
227 |
print(f"Prepared Tool objects with names: {[tool.name for tool in self.actual_tools_for_agent]}")
|
228 |
|
229 |
# --- Step 3: Pass the PRE-INITIALIZED pipeline object to HfAgent ---
|
230 |
+
print("Initializing HfAgent with the pre-created pipeline...")
|
231 |
+
self.agent = HfAgent(
|
232 |
+
llm_pipeline, # Pass the pipeline object directly as the first argument
|
233 |
additional_tools=self.actual_tools_for_agent
|
234 |
)
|
235 |
+
print("HfAgent successfully instantiated with pre-initialized pipeline.")
|
236 |
|
237 |
except Exception as e:
|
238 |
print(f"CRITICAL ERROR: Failed to initialize HfAgent or Pipeline: {e}")
|