Spaces:
Running
Running
update import
Browse files
demo.py
CHANGED
@@ -688,7 +688,7 @@ Keep the description concise and informative. Respond with just the task descrip
|
|
688 |
print(f"Warning: Failed to generate task description via API: {str(e)}")
|
689 |
return "General query processing task requiring analysis and response generation."
|
690 |
|
691 |
-
def get_routed_llm(query: str, config_path: str =
|
692 |
"""
|
693 |
Use graph router to get the best LLM for a query.
|
694 |
|
@@ -716,8 +716,12 @@ def get_routed_llm(query: str, config_path: str = "GraphRouter_eval/configs/conf
|
|
716 |
os.chdir(graph_router_dir)
|
717 |
|
718 |
try:
|
|
|
|
|
|
|
|
|
719 |
# Load configuration
|
720 |
-
with open(
|
721 |
config = yaml.safe_load(file)
|
722 |
|
723 |
# Load training data
|
|
|
688 |
print(f"Warning: Failed to generate task description via API: {str(e)}")
|
689 |
return "General query processing task requiring analysis and response generation."
|
690 |
|
691 |
+
def get_routed_llm(query: str, config_path: str = None) -> Tuple[str, str, str]:
|
692 |
"""
|
693 |
Use graph router to get the best LLM for a query.
|
694 |
|
|
|
716 |
os.chdir(graph_router_dir)
|
717 |
|
718 |
try:
|
719 |
+
# Use default config path if none provided
|
720 |
+
if config_path is None:
|
721 |
+
config_path = 'configs/config.yaml'
|
722 |
+
|
723 |
# Load configuration
|
724 |
+
with open(config_path, 'r', encoding='utf-8') as file:
|
725 |
config = yaml.safe_load(file)
|
726 |
|
727 |
# Load training data
|