Former-commit-id: d6179f3b2f87841bb7c01f39a5ca8d81748ea580
pull/160/head
Kye 2 years ago
parent d1844938c6
commit 23fea659e8

@ -70,7 +70,7 @@ class HierarchicalSwarm:
def initialize_llm(self, llm_class, temperature=0.5): def initialize_llm(self, llm_class):
""" """
Init LLM Init LLM
@ -80,14 +80,10 @@ class HierarchicalSwarm:
""" """
try: try:
# Initialize language model # Initialize language model
if self.llm_class == OpenAI: return llm_class(openai_api_key=self.openai_api_key, temperature=self.temperature)
return llm_class(openai_api_key=self.openai_api_key, temperature=self.temperature)
else:
return self.llm_class(model_id="gpt-2", temperature=self.temperature)
except Exception as e: except Exception as e:
logging.error(f"Failed to initialize language model: {e}") logging.error(f"Failed to initialize language model: {e}")
def initialize_tools(self, llm_class, extra_tools=None): def initialize_tools(self, llm_class, extra_tools=None):
""" """
Init tools Init tools

Loading…
Cancel
Save