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

Working #32

Merged
merged 27 commits into from
Oct 19, 2023
Merged

Working #32

merged 27 commits into from
Oct 19, 2023

Conversation

Daethyra
Copy link
Owner

No description provided.

- Generated by GitHub Copilot

I made several changes to the code. First, I added a PDFProcessor class to handle PDF document processing, similarity search, and question answering. The class has several methods to perform these tasks, including load_pdfs_from_directory, perform_similarity_search, and answer_question.

I also added a get_user_query method to get user input for a query or question.

In the load_pdfs_from_directory method, I modified the code to use the DirectoryLoader class from langchain.document_loaders to load all PDF files from a given directory. I then split the loaded documents into chunks, stored them in a vectorstore, and initialized the RAG model for question answering.

In the perform_similarity_search method, I modified the code to take a list of documents and a query as input, and return a list of dictionaries containing the similarity score, document or chunk, and any other relevant metadata.

In the answer_question method, I modified the code to use the RAG model to answer the input question.

Finally, in the __main__ block, I created an instance of the PDFProcessor class, loaded PDFs from a directory, performed similarity search based on a query, and answered a question using the RAG model.

	modified:   LangChain/Retrieval-Agents/qa_local_docs.py
- Added updates to TODO for qa_local_docs.py
	renamed:    LangChain/Retrieval-Agents/stateful_chatbot.py -> LangChain/Chatbots/stateful_chatbot.py
	renamed:    LangChain/Retrieval-Agents/__init__.py -> LangChain/Retrieval-Augmented-Generation/__init__.py
	new file:   LangChain/Retrieval-Augmented-Generation/main.py
	renamed:    LangChain/Retrieval-Agents/qa_local_docs.py -> LangChain/Retrieval-Augmented-Generation/qa_local_docs.py
	modified:   todo.md
	modified:   LangChain/Retrieval-Augmented-Generation/qa_local_docs.py
	new file:   LangChain/Retrieval-Augmented-Generation/test.py
	new file:   LangChain/Retrieval-Augmented-Generation/.env.template
	modified:   LangChain/Retrieval-Augmented-Generation/qa_local_docs.py
	modified:   LangChain/Retrieval-Augmented-Generation/test.py
	renamed:    OpenAI/GPT-Prompt-Examples/MS-6_Daethyra_Custom-Instruction_GPT4.md -> OpenAI/Prompts/MS-6_Daethyra_Custom-Instruction_GPT4.md
	renamed:    OpenAI/GPT-Prompt-Examples/multi-shot/MS-1.MD -> OpenAI/Prompts/multi-shot/MS-1.MD
	renamed:    OpenAI/GPT-Prompt-Examples/multi-shot/MS-2_Large-Template.txt -> OpenAI/Prompts/multi-shot/MS-2_Large-Template.txt
	renamed:    OpenAI/GPT-Prompt-Examples/multi-shot/MS-5_No-Prose_Doc-Reader.txt -> OpenAI/Prompts/multi-shot/MS-5_No-Prose_Doc-Reader.txt
	renamed:    OpenAI/GPT-Prompt-Examples/OUT-prompt-cheatsheet.md -> OpenAI/Prompts/prompt-cheatsheet.md
	renamed:    OpenAI/GPT-Prompt-Examples/system-role/SR-1_List-o-Prompts.md -> OpenAI/Prompts/system-role/SR-1_List-o-Prompts.md
	renamed:    OpenAI/GPT-Prompt-Examples/system-role/SR-2_package-migration.md -> OpenAI/Prompts/system-role/SR-2_package-migration.md
	renamed:    OpenAI/GPT-Prompt-Examples/system-role/SR-3_thorough-programmer.md -> OpenAI/Prompts/system-role/SR-3_thorough-programmer.md
	renamed:    OpenAI/GPT-Prompt-Examples/system-role/SR-4_online-searches.md -> OpenAI/Prompts/system-role/SR-4_online-searches.md
	renamed:    OpenAI/GPT-Prompt-Examples/user-role/UR-1.MD -> OpenAI/Prompts/user-role/UR-1.MD
	renamed:    OpenAI/GPT-Prompt-Examples/user-role/UR-2.md -> OpenAI/Prompts/user-role/UR-2.md
	modified:   README.md
…gFace's Accelerate library.

	new file:   HuggingFace/Accelerate/.env.template
	new file:   HuggingFace/Accelerate/README.md
	new file:   HuggingFace/Accelerate/fine_tune_sequence_classification_model.py
A bunch of updates still required for conference with the repo's directory structure
	new file:   LangChain/Chatbots/chroma_memory.py
	new file:   LangChain/Chatbots/how-to_chroma-memory.md
	deleted:    LangChain/Chatbots/stateful_chatbot.py
	modified:   README.md
new file:   Prompts/user-role/UR-3.md
@Daethyra Daethyra enabled auto-merge October 19, 2023 03:21
@Daethyra Daethyra merged commit d68f517 into master Oct 19, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idea for prompt: YouTube video summarization Bing intro ST Prompt 1 - User Role
1 participant