diff --git a/=0.3.0 b/=0.3.0 new file mode 100644 index 00000000..e69de29b diff --git a/=3.38.0 b/=3.38.0 new file mode 100644 index 00000000..9d3ed255 --- /dev/null +++ b/=3.38.0 @@ -0,0 +1,64 @@ +Defaulting to user installation because normal site-packages is not writeable +Requirement already satisfied: gradio_client in /home/zack/.local/lib/python3.10/site-packages (0.2.5) +Requirement already satisfied: gradio in /home/zack/.local/lib/python3.10/site-packages (3.33.1) +Requirement already satisfied: fsspec in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (2023.5.0) +Requirement already satisfied: httpx in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (0.24.1) +Requirement already satisfied: huggingface-hub>=0.13.0 in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (0.16.4) +Requirement already satisfied: packaging in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (23.2) +Requirement already satisfied: requests in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (2.27.1) +Requirement already satisfied: typing-extensions in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (4.8.0) +Requirement already satisfied: websockets in /home/zack/.local/lib/python3.10/site-packages (from gradio_client) (11.0.3) +Requirement already satisfied: aiofiles in /home/zack/.local/lib/python3.10/site-packages (from gradio) (23.1.0) +Requirement already satisfied: aiohttp in /home/zack/.local/lib/python3.10/site-packages (from gradio) (3.8.4) +Requirement already satisfied: altair>=4.2.0 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (4.2.2) +Requirement already satisfied: fastapi in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.100.1) +Requirement already satisfied: ffmpy in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.3.0) +Requirement already satisfied: jinja2 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (3.1.2) +Requirement already satisfied: markdown-it-py[linkify]>=2.0.0 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (2.2.0) +Requirement already satisfied: markupsafe in /home/zack/.local/lib/python3.10/site-packages (from gradio) (2.1.3) +Requirement already satisfied: matplotlib in /home/zack/.local/lib/python3.10/site-packages (from gradio) (3.1.3) +Requirement already satisfied: mdit-py-plugins<=0.3.3 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.3.3) +Requirement already satisfied: numpy in /home/zack/.local/lib/python3.10/site-packages (from gradio) (1.22.4) +Requirement already satisfied: orjson in /home/zack/.local/lib/python3.10/site-packages (from gradio) (3.9.7) +Requirement already satisfied: pandas in /home/zack/.local/lib/python3.10/site-packages (from gradio) (1.4.2) +Requirement already satisfied: pillow in /home/zack/.local/lib/python3.10/site-packages (from gradio) (9.5.0) +Requirement already satisfied: pydantic in /home/zack/.local/lib/python3.10/site-packages (from gradio) (1.8.2) +Requirement already satisfied: pydub in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.25.1) +Requirement already satisfied: pygments>=2.12.0 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (2.16.1) +Requirement already satisfied: python-multipart in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.0.6) +Requirement already satisfied: pyyaml in /home/zack/.local/lib/python3.10/site-packages (from gradio) (6.0) +Requirement already satisfied: semantic-version in /home/zack/.local/lib/python3.10/site-packages (from gradio) (2.10.0) +Requirement already satisfied: uvicorn>=0.14.0 in /home/zack/.local/lib/python3.10/site-packages (from gradio) (0.18.3) +Requirement already satisfied: entrypoints in /home/zack/.local/lib/python3.10/site-packages (from altair>=4.2.0->gradio) (0.4) +Requirement already satisfied: jsonschema>=3.0 in /home/zack/.local/lib/python3.10/site-packages (from altair>=4.2.0->gradio) (4.19.1) +Requirement already satisfied: toolz in /home/zack/.local/lib/python3.10/site-packages (from altair>=4.2.0->gradio) (0.12.0) +Requirement already satisfied: filelock in /home/zack/.local/lib/python3.10/site-packages (from huggingface-hub>=0.13.0->gradio_client) (3.12.4) +Requirement already satisfied: tqdm>=4.42.1 in /home/zack/.local/lib/python3.10/site-packages (from huggingface-hub>=0.13.0->gradio_client) (4.64.0) +Requirement already satisfied: mdurl~=0.1 in /home/zack/.local/lib/python3.10/site-packages (from markdown-it-py[linkify]>=2.0.0->gradio) (0.1.2) +Requirement already satisfied: linkify-it-py<3,>=1 in /home/zack/.local/lib/python3.10/site-packages (from markdown-it-py[linkify]>=2.0.0->gradio) (2.0.2) +Requirement already satisfied: python-dateutil>=2.8.1 in /home/zack/.local/lib/python3.10/site-packages (from pandas->gradio) (2.8.2) +Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas->gradio) (2022.1) +Requirement already satisfied: click>=7.0 in /home/zack/.local/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (8.1.6) +Requirement already satisfied: h11>=0.8 in /home/zack/.local/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (0.14.0) +Requirement already satisfied: attrs>=17.3.0 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (23.1.0) +Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (2.0.12) +Requirement already satisfied: multidict<7.0,>=4.5 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (6.0.4) +Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (4.0.2) +Requirement already satisfied: yarl<2.0,>=1.0 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (1.9.2) +Requirement already satisfied: frozenlist>=1.1.1 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (1.3.3) +Requirement already satisfied: aiosignal>=1.1.2 in /home/zack/.local/lib/python3.10/site-packages (from aiohttp->gradio) (1.3.1) +Requirement already satisfied: starlette<0.28.0,>=0.27.0 in /home/zack/.local/lib/python3.10/site-packages (from fastapi->gradio) (0.27.0) +Requirement already satisfied: certifi in /home/zack/.local/lib/python3.10/site-packages (from httpx->gradio_client) (2023.5.7) +Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /home/zack/.local/lib/python3.10/site-packages (from httpx->gradio_client) (0.17.0) +Requirement already satisfied: idna in /home/zack/.local/lib/python3.10/site-packages (from httpx->gradio_client) (3.4) +Requirement already satisfied: sniffio in /home/zack/.local/lib/python3.10/site-packages (from httpx->gradio_client) (1.3.0) +Requirement already satisfied: cycler>=0.10 in /usr/lib/python3/dist-packages (from matplotlib->gradio) (0.11.0) +Requirement already satisfied: kiwisolver>=1.0.1 in /usr/lib/python3/dist-packages (from matplotlib->gradio) (1.3.2) +Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3/dist-packages (from matplotlib->gradio) (2.4.7) +Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/zack/.local/lib/python3.10/site-packages (from requests->gradio_client) (1.26.17) +Requirement already satisfied: anyio<5.0,>=3.0 in /home/zack/.local/lib/python3.10/site-packages (from httpcore<0.18.0,>=0.15.0->httpx->gradio_client) (3.6.2) +Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/zack/.local/lib/python3.10/site-packages (from jsonschema>=3.0->altair>=4.2.0->gradio) (2023.7.1) +Requirement already satisfied: referencing>=0.28.4 in /home/zack/.local/lib/python3.10/site-packages (from jsonschema>=3.0->altair>=4.2.0->gradio) (0.30.2) +Requirement already satisfied: rpds-py>=0.7.1 in /home/zack/.local/lib/python3.10/site-packages (from jsonschema>=3.0->altair>=4.2.0->gradio) (0.10.3) +Requirement already satisfied: uc-micro-py in /home/zack/.local/lib/python3.10/site-packages (from linkify-it-py<3,>=1->markdown-it-py[linkify]>=2.0.0->gradio) (1.0.2) +Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.1->pandas->gradio) (1.16.0) diff --git a/groupchat.py b/groupchat.py index 4cc74fbf..48724630 100644 --- a/groupchat.py +++ b/groupchat.py @@ -4,7 +4,7 @@ from swarms.workers import Worker llm = OpenAIChat( model_name='gpt-4', - openai_api_key="api-key", + openai_api_key="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", temperature=0.5 ) @@ -57,9 +57,9 @@ group = GroupChat( manager = GroupChatManager( groupchat=group, - # max_consecutive_auto_reply=3, - # human_input_mode="NEVER", - # system_message="Group chat manager" + max_consecutive_auto_reply=3, + human_input_mode="NEVER", + system_message="Group chat manager" ) output = group.run( diff --git a/omni_ui.py b/omni_ui.py index 57ee68a9..bc445801 100644 --- a/omni_ui.py +++ b/omni_ui.py @@ -6,18 +6,17 @@ import glob import base64 from langchain.llms import OpenAIChat from swarms.agents import OmniModalAgent -import gradio_client as grc -from dspy import Program, Prompt, Finetune, Decompose -from dspy import Program, Prompt, Finetune, Decompose - -grc.Client("Wawaa/omni_bot").deploy_discord() # Function to convert image to base64 + + def image_to_base64(image_path): with open(image_path, "rb") as image_file: return base64.b64encode(image_file.read()).decode() # Function to get the most recently created image in the directory + + def get_latest_image(): list_of_files = glob.glob('./*.png') # Replace with your image file type if not list_of_files: @@ -27,13 +26,15 @@ def get_latest_image(): # Initialize your OmniModalAgent -llm = OpenAIChat(model_name="gpt-4") # Replace with your actual initialization +llm = OpenAIChat(model_name="gpt-4",openai_api_key="OPENAI_API_KEY") # Replace with your actual initialization agent = OmniModalAgent(llm) # Replace with your actual initialization # Global variable to store chat history chat_history = [] # Function to update chat + + def update_chat(user_input): global chat_history chat_history.append({"type": "user", "content": user_input}) @@ -54,6 +55,8 @@ def update_chat(user_input): return render_chat(chat_history) # Function to render chat as HTML + + def render_chat(chat_history): chat_str = "
" for message in chat_history: @@ -78,6 +81,8 @@ iface = Interface( ) # Function to update the chat display + + def update_display(): global chat_history while True: