Skip to content

Commit

Permalink
fix: Addressed the file upload issue with filenames in Hebrew languag…
Browse files Browse the repository at this point in the history
…e in ingest documents screen (#1376)
  • Loading branch information
Prasanjeet-Microsoft authored Oct 4, 2024
1 parent 3963114 commit 6d77789
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/backend/pages/01_Ingest_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ def add_url_embeddings(urls: list[str]):
for up in uploaded_files:
# To read file as bytes:
bytes_data = up.getvalue()
title = up.name.encode("latin-1", "replace").decode("latin-1")
if st.session_state.get("filename", "") != up.name:
# Upload a new file
st.session_state["filename"] = up.name
st.session_state["file_url"] = blob_client.upload_file(
bytes_data, up.name, metadata={"title": up.name}
bytes_data, up.name, metadata={"title": title}
)
if len(uploaded_files) > 0:
st.success(
Expand Down

0 comments on commit 6d77789

Please sign in to comment.