openai fix, + gpt4v in the __init__

pull/136/head
Kye 1 year ago
parent 0d0e5e5dc3
commit 7db6930bd4

@ -74,7 +74,10 @@ flow = Flow(
# out = flow.load_state("flow_state.json")
# temp = flow.dynamic_temperature()
# filter = flow.add_response_filter("Trump")
# Run the flow
out = flow.run("Generate a 10,000 word blog on health and wellness.")
# out = flow.validate_response(out)
# out = flow.analyze_feedback(out)
# 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]
python = "^3.8.1"
transformers = "*"
openai = "*"
openai = "0.28.0"
langchain = "*"
asyncio = "*"
nest_asyncio = "*"
@ -36,6 +36,7 @@ playwright = "*"
duckduckgo-search = "*"
faiss-cpu = "*"
backoff = "*"
marshmallow = "*"
datasets = "*"
diffusers = "*"
accelerate = "*"

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

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

Loading…
Cancel
Save