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

[ENG-856] Remove large file from repo #187

Merged
merged 4 commits into from
Jun 17, 2024
Merged
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
Binary file removed tests/large_image.png
Binary file not shown.
19 changes: 14 additions & 5 deletions tests/test_magentic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import Literal

import openai
Expand Down Expand Up @@ -188,14 +189,22 @@ async def _generate_title_and_description(query: str, widget_data: str) -> Widge
).assert_function_call_response()


@pytest.mark.async_client
@pytest.mark.widget
@pytest.mark.asyncio(scope="module")
async def test_large_image_upload(session, magentic_model):
@pytest.mark.vision
def test_large_image_upload(session):
# If large_image.png doesn't exist, download it from https://log10py-public.s3.us-east-2.amazonaws.com/large_image.png
if not os.path.exists("./tests/large_image.png"):
import requests

url = "https://log10py-public.s3.us-east-2.amazonaws.com/large_image.png"
response = requests.get(url)
with open("./tests/large_image.png", "wb") as f:
f.write(response.content)

with open("./tests/large_image.png", "rb") as f:
image_bytes = f.read()

@chatprompt(SystemMessage("What's in the following screenshot?"), UserImageMessage(image_bytes))
def _llm() -> str: ...

_llm()
output = _llm()
assert isinstance(output, str)
Loading