Skip to content

Commit

Permalink
nit– cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Feb 4, 2025
1 parent 4e9b377 commit 1548252
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion backend/onyx/file_store/file_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def save_file(
# The large objects in postgres are saved as special objects can be listed with
# SELECT * FROM pg_largeobject_metadata;
obj_id = create_populate_lobj(content=content, db_session=self.db_session)
print("uPLODING FILE TO FILE NAME", file_name)
upsert_pgfilestore(
file_name=file_name,
display_name=display_name or file_name,
Expand Down
3 changes: 0 additions & 3 deletions backend/onyx/server/query_and_chat/chat_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,14 +719,11 @@ def upload_files_for_chat(

file_content = file.file.read() # Read the file content

# if file_type == ChatFileType.IMAGE:
# file_content_io = file.file
# NOTE: Image conversion to JPEG used to be enforced here.
# This was removed to:
# 1. Preserve original file content for downloads
# 2. Maintain transparency in formats like PNG
# 3. Ameliorate issue with file conversion
# else:/
file_content_io = io.BytesIO(file_content)

new_content_type = file.content_type
Expand Down
2 changes: 0 additions & 2 deletions web/src/app/chat/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,10 @@ export async function uploadFilesForChat(
method: "POST",
body: formData,
});
alert("RESPONSE");
if (!response.ok) {
return [[], `Failed to upload files - ${(await response.json()).detail}`];
}
const responseJson = await response.json();
alert(JSON.stringify(responseJson));

return [responseJson.files as FileDescriptor[], null];
}
Expand Down

0 comments on commit 1548252

Please sign in to comment.