Skip to content

Add Streamlit app for multi-PDF RAG QA#230

Open
jeonghoonkang wants to merge 1 commit intomasterfrom
codex/create-pdf-search-webpage-with-rag-pipeline-q5a3c5
Open

Add Streamlit app for multi-PDF RAG QA#230
jeonghoonkang wants to merge 1 commit intomasterfrom
codex/create-pdf-search-webpage-with-rag-pipeline-q5a3c5

Conversation

@jeonghoonkang
Copy link
Copy Markdown
Owner

Summary

  • Add streamlit_multi_pdf_rag.py demonstrating multi-PDF retrieval-augmented QA using OpenAI models
  • Show uploaded file list, support multiple drag-and-drop uploads, and display model version
  • Prompt user for an OpenAI API key to configure the client
  • Switch RAG pipeline to use Ollama for model execution and allow selecting generation/embedding models
  • Add button to download OSS models via ollama pull

Testing

  • python -m py_compile apps/openai_pdf_rag/streamlit_multi_pdf_rag.py
  • pytest (fails: missing modules and Python 2 syntax in existing tests)

https://chatgpt.com/codex/tasks/task_e_68b5320a3cd48331ac4f053b8be70da4

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +14 to +20
# 현재 설치된 모델 목록을 가져와 선택 박스에 표시
available_models = [m["name"] for m in ollama.list().get("models", [])]

gen_model = st.selectbox("생성 모델", options=available_models) if available_models else st.text_input(
"생성 모델 이름"
)
embed_models = [m for m in available_models if "embed" in m]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Guard ollama.list() when the daemon is unavailable

The script calls ollama.list() during app initialization and immediately subscripts its result. When the Ollama daemon is not installed or running (a common scenario on first launch), this call raises a connection error before Streamlit can render anything, leaving users with a crash instead of a helpful message or a fallback. Wrapping the call in a try/except and surfacing a warning would make the app usable even when models are not yet available.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant