Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove heavy models #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.10"
torch = "*"
transformers = "*"
diffusers = "*"
#torch = "*"
#transformers = "*"
#diffusers = "*"
loguru = "*"
pydantic = "*"
langchain-community = "0.0.29"
together = "*"
#langchain-community = "0.0.29"
#together = "*"
python-dotenv = "*"
litellm = "*"

Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
torch
transformers
diffusers
#torch
#transformers
#diffusers
loguru
pydantic
langchain-community=="0.0.29"
together
litellm
#langchain-community=="0.0.29"
#together
litellm
14 changes: 7 additions & 7 deletions swarm_models/base_multimodal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from io import BytesIO
from typing import List, Optional, Tuple
import requests
from PIL import Image
from termcolor import colored

#from PIL import Image
#from termcolor import colored

class BaseMultiModalModel:
"""
Expand Down Expand Up @@ -123,8 +122,8 @@ def get_img_from_web(self, img: str, *args, **kwargs):
try:
response = requests.get(img)
response.raise_for_status()
image_pil = Image.open(BytesIO(response.content))
return image_pil
# image_pil = Image.open(BytesIO(response.content))
return None
except requests.RequestException as error:
print(
f"Error fetching image from {img} and error: {error}"
Expand All @@ -138,7 +137,8 @@ def encode_img(self, img: str):

def get_img(self, img: str):
"""Get the image from the path"""
image_pil = Image.open(img)
#image_pil = Image.open(img)
image_pil = None
return image_pil

def clear_chat_history(self):
Expand Down Expand Up @@ -284,7 +284,7 @@ def get_chat_history_tokens(self):

def print_beautiful(self, content: str, color: str = "cyan"):
"""Print Beautifully with termcolor"""
content = colored(content, color)
#content = colored(content, color)
print(content)

def stream_response(self, text: str):
Expand Down
Loading