openai fix, + gpt4v in the __init__

Former-commit-id: 7db6930bd4
clean-history
Kye 1 year ago
parent a85d956b5c
commit 38a06f8243

@ -74,7 +74,10 @@ flow = Flow(
# out = flow.load_state("flow_state.json") # out = flow.load_state("flow_state.json")
# temp = flow.dynamic_temperature() # temp = flow.dynamic_temperature()
# filter = flow.add_response_filter("Trump") # filter = flow.add_response_filter("Trump")
# Run the flow
out = flow.run("Generate a 10,000 word blog on health and wellness.") out = flow.run("Generate a 10,000 word blog on health and wellness.")
# out = flow.validate_response(out) # out = flow.validate_response(out)
# out = flow.analyze_feedback(out) # out = flow.analyze_feedback(out)
# out = flow.print_history_and_memory() # out = flow.print_history_and_memory()

@ -1,8 +0,0 @@
from swarms.models import Dalle3
dalle3 = Dalle3(
openai_api_key=""
)
task = "A painting of a dog"
image_url = dalle3(task)
print(image_url)

@ -1,12 +0,0 @@
from swarms.models.gpt4v import GPT4Vision
gpt4vision = GPT4Vision(openai_api_key="")
img = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/VFPt_Solenoid_correct2.svg/640px-VFPt_Solenoid_correct2.svg.png"
task = "What is this image"
answer = gpt4vision.run(task, img)
print(answer)

@ -24,7 +24,7 @@ classifiers = [
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8.1" python = "^3.8.1"
transformers = "*" transformers = "*"
openai = "*" openai = "0.28.0"
langchain = "*" langchain = "*"
asyncio = "*" asyncio = "*"
nest_asyncio = "*" nest_asyncio = "*"
@ -36,6 +36,7 @@ playwright = "*"
duckduckgo-search = "*" duckduckgo-search = "*"
faiss-cpu = "*" faiss-cpu = "*"
backoff = "*" backoff = "*"
marshmallow = "*"
datasets = "*" datasets = "*"
diffusers = "*" diffusers = "*"
accelerate = "*" accelerate = "*"

@ -61,6 +61,7 @@ timm
torchmetrics torchmetrics
transformers transformers
webdataset webdataset
marshmallow
yapf yapf
autopep8 autopep8
dalle3 dalle3

@ -4,25 +4,25 @@ log_file = open("errors.txt", "w")
sys.stderr = log_file sys.stderr = log_file
# LLMs # LLMs
from swarms.models.anthropic import Anthropic from swarms.models.anthropic import Anthropic # noqa: E402
from swarms.models.petals import Petals from swarms.models.petals import Petals # noqa: E402
from swarms.models.mistral import Mistral from swarms.models.mistral import Mistral # noqa: E402
from swarms.models.openai_models import OpenAI, AzureOpenAI, OpenAIChat from swarms.models.openai_models import OpenAI, AzureOpenAI, OpenAIChat # noqa: E402
from swarms.models.zephyr import Zephyr from swarms.models.zephyr import Zephyr # noqa: E402
from swarms.models.biogpt import BioGPT from swarms.models.biogpt import BioGPT # noqa: E402
from swarms.models.huggingface import HuggingfaceLLM from swarms.models.huggingface import HuggingfaceLLM # noqa: E402
from swarms.models.wizard_storytelling import WizardLLMStoryTeller from swarms.models.wizard_storytelling import WizardLLMStoryTeller # noqa: E402
from swarms.models.mpt import MPT7B from swarms.models.mpt import MPT7B # noqa: E402
# MultiModal Models # MultiModal Models
from swarms.models.idefics import Idefics from swarms.models.idefics import Idefics # noqa: E402
from swarms.models.kosmos_two import Kosmos from swarms.models.kosmos_two import Kosmos # noqa: E402
from swarms.models.vilt import Vilt from swarms.models.vilt import Vilt # noqa: E402
from swarms.models.nougat import Nougat from swarms.models.nougat import Nougat # noqa: E402
from swarms.models.layoutlm_document_qa import LayoutLMDocumentQA from swarms.models.layoutlm_document_qa import LayoutLMDocumentQA # noqa: E402
from swarms.models.gpt4v import GPT4Vision # from swarms.models.gpt4v import GPT4Vision
from swarms.models.dalle3 import Dalle3 # from swarms.models.dalle3 import Dalle3
from swarms.models.distilled_whisperx import DistilWhisperModel # from swarms.models.distilled_whisperx import DistilWhisperModel # noqa: E402
__all__ = [ __all__ = [
"Anthropic", "Anthropic",
@ -41,6 +41,6 @@ __all__ = [
"HuggingfaceLLM", "HuggingfaceLLM",
"MPT7B", "MPT7B",
"WizardLLMStoryTeller", "WizardLLMStoryTeller",
"GPT4Vision", # "GPT4Vision",
"Dalle3", # "Dalle3",
] ]

Loading…
Cancel
Save