From 70c1359a2e6feaed723c215afc0181ed3d7b6fa0 Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 3 Oct 2023 15:59:21 -0400 Subject: [PATCH] mm example --- multi_modal_agent_example.py | 12 ++++++++++++ swarms/agents/multi_modal_visual_agent.py | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 multi_modal_agent_example.py diff --git a/multi_modal_agent_example.py b/multi_modal_agent_example.py new file mode 100644 index 00000000..e6b708a3 --- /dev/null +++ b/multi_modal_agent_example.py @@ -0,0 +1,12 @@ +from swarms import MultiModalAgent + +node = MultiModalAgent() + +text = node.run_text("What is your name? Generate a picture of yourself") + +img = node.run_img("/image1", "What is this image about?") + +chat = node.chat( + "What is your name? Generate a picture of yourself. What is this image about?", + streaming=True +) diff --git a/swarms/agents/multi_modal_visual_agent.py b/swarms/agents/multi_modal_visual_agent.py index 1e8b1e3d..c022af1e 100644 --- a/swarms/agents/multi_modal_visual_agent.py +++ b/swarms/agents/multi_modal_visual_agent.py @@ -1648,7 +1648,7 @@ class MultiModalAgent: def run_text( self, text: str = None, - language=None + language = "english" ): """Run text through the model""" @@ -1664,7 +1664,7 @@ class MultiModalAgent: def run_img( self, image_path: str, - language=None + language = "english" ): """If language is None""" if language is None: @@ -1681,7 +1681,7 @@ class MultiModalAgent: def chat( self, msg: str = None, - language: str = None, + language: str = "english", streaming: bool = False ): """