From bd3bd2597b494587de6feb519619fd7f7f0904aa Mon Sep 17 00:00:00 2001 From: Kye Date: Fri, 18 Aug 2023 13:28:34 -0400 Subject: [PATCH] huggingface example Former-commit-id: fc0ec27405151743a0db841e48c7e497d3f7dd82 --- README.md | 7 ++++--- swarms/agents/base.py | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2c7b4c20..df32e4a9 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,11 @@ swarm(objective) ## Usage ```python -from swarms import OpenAI -chat = OpenAI() -response = chat("Hello world!") +from swarms import HuggingFaceLLM + +hugging_face_model = HuggingFaceLLM(model_id="Voicelab/trurl-2-13b") +generated_text = hugging_face_model.generate("In a world where AI") ``` diff --git a/swarms/agents/base.py b/swarms/agents/base.py index 5a999416..ba0b26fa 100644 --- a/swarms/agents/base.py +++ b/swarms/agents/base.py @@ -76,10 +76,8 @@ class Agent: user_input = ( "Determine which next command to use, and respond using the format specified above:" ) - # Interaction Loop loop_count = 0 while True: - # Discontinue if continuous limit is reached loop_count += 1 # Send message to AI, get response @@ -90,7 +88,6 @@ class Agent: user_input=user_input, ) - # Print Assistant thoughts print(assistant_reply) self.chat_history_memory.add_message(HumanMessage(content=user_input)) self.chat_history_memory.add_message(AIMessage(content=assistant_reply))