Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Jae-hoya
Copy link
Contributor

@Jae-hoya Jae-hoya commented Jan 8, 2025

{PR Message - Write freely, remove this bracket if unnecessary}

[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"

Author Checklist

  • [O] PR Title Format: I have confirmed that the PR title follows the correct format. (e.g., [N-2] 07-Text Splitter / 07-RecursiveCharacterTextSplitter)

  • [O] Committed Files: I have ensured that no unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) are included. These files are not allowed.

  • [] (Optional) Related Issue: If this PR is linked to an issue, I have referenced the issue number in the PR message. (e.g., Fixes Update 01-PromptTemplate.ipynb #123)

  • ❌ Do not include unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) or other people's code. If included, close the PR and create a new PR.

Review Template (Intial PR)

🖥️ OS: Win/Mac/Linux   
✅ Checklist      
 - [ ] **Template**: Tutorials follows the required template. 
 - [ ] **Table of Contents(TOC) Links**: All Table of Contents links work. ((Yes/No)
 - [ ] **Image**: Image filenames follow guidelines.
 - [ ] **Imports*: All import statements use the latest versions. Ensure "langchain-teddynote" is not used. 
 - [ ] **Code Execution**: Code runs without errors.
 - Comments: {Write freely, 한국어 기술 가능}     

If no one reviews your PR within a few days, please @-mention one of teddylee777, musangk, BAEM1N

Jae-hoya and others added 10 commits January 5, 2025 23:59
[Title] PydanticOutputParser
[Version] second
[Language] ENG
[Packgage] langchain-openai, langchain-core, pydantic
[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"
.
 이전 pr이 mr되지 않아 겹치지 않아 작업 완료된 파일을 뻇습니다.
[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"
[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"
[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"
[Title] 02-RAG-Advanced.ipynb
[Version] initial
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"
Copy link
Contributor

@LEE1026icarus LEE1026icarus left a comment

Choose a reason for hiding this comment

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

🖥️ OS: Win/
✅ Checklist

  • Template: Tutorials follows the required template.
  • Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
  • Image: Image filenames follow guidelines.
  • *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
  • Code Execution: Code runs without errors.
  • Comments: txt 파일 인코딩을 UTF-8로 변경해야 문서로드가 가능했습니다. "loader = TextLoader("data/appendix-keywords_eng.txt", encoding="utf-8")" 이렇게 코드를 수정함이 어떤가 싶습니다. 또한 DirectoryLoader 패키지로는 pdf파일이 로드가 안되는 것같은데 제 컴퓨터 문제일 수도 있어서 확인 한 번 더 부탁드립니다.

abstract

  • TextLoader를 사용할 때 encoding="utf-8" 옵션을 추가하여 txt 파일 인코딩 문제 해결.
  • DirectoryLoader로 pdf 파일 로드가 안 되는 문제 발생. (본인 컴퓨터 문제일 가능성도 있음)

[Title] 02-RAG-Advanced.ipynb
[Version] Second
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"

textloader에 encoding 추가,
package에 pypdf2추가
@Jae-hoya
Copy link
Contributor Author

Jae-hoya commented Jan 9, 2025

일단 리뷰해주신 순형님 너무 감사드립니다!

  1. TextLoader를 사용할 때 encoding="utf-8" 옵션을 추가하여 txt 파일 인코딩 문제 해결.
    -> 리뷰어님 요청에따라 수정을 하였씁니다
  2. DirectoryLoader로 pdf 파일 로드가 안 되는 문제 발생. (본인 컴퓨터 문제일 가능성도 있음)
    -> Unstructured[pdf] 모듈에러이실까요?
    -> 컴퓨터 문제일수도 있다고 말씀하시니, colab에서 실행해 보시는것도 좋을 것 같습니다.

@LEE1026icarus LEE1026icarus self-requested a review January 9, 2025 13:17
@LEE1026icarus LEE1026icarus marked this pull request as draft January 9, 2025 13:18
@LEE1026icarus LEE1026icarus marked this pull request as ready for review January 9, 2025 13:19
LEE1026icarus
LEE1026icarus previously approved these changes Jan 9, 2025
Copy link
Contributor

@LEE1026icarus LEE1026icarus left a comment

Choose a reason for hiding this comment

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

🖥️ OS: Win
✅ Checklist

  • Template: Tutorials follows the required template.
  • Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
  • Image: Image filenames follow guidelines.
  • *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
  • Code Execution: Code runs without errors.
  • Comments: 다시 리뷰 해보니 다 잘돌아갑니다. 고생하셨습니다!

@teddylee777 teddylee777 requested a review from BAEM1N January 9, 2025 13:44
BAEM1N
BAEM1N previously approved these changes Jan 9, 2025
Copy link
Contributor

@BAEM1N BAEM1N left a comment

Choose a reason for hiding this comment

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

🖥️ OS: Mac
✅ Checklist

  • Template: Tutorials follows the required template.
  • Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
  • Image: Image filenames follow guidelines.
    • 디자인팀 채널에 보면 RAG Process에 7번 Model(LLM)이 수정된 이미지가 있어 해당 이미지로 변경 요청 드립니다.
    • Indexing과 Retrieval and Generation에서 사용한 그림은 Langchain 튜토리얼에서 본 적 있는 거 같은데 저작권 문제는 확인하셨을까요?
  • *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
    • 각 코드 셀에서 import를 하고 있어서 Explore Each Module에 전체 import를 하는 코드 셀이 필요한가 하고 생각이 듭니다. (@teddylee777 )
  • Code Execution: Code runs without errors.
    • Apple Silicon 맥에서는 libmagic 관련 오류가 발생하는 것으로 보입니다. 설치 방법이 따로 안내가 나가야 할 거 같아 이 부분은 인프라에서도 같이 고민하겠습니다.
  • Comments: {Write freely, 한국어 기술 가능}
    • Peer Review는 Infra에서 일괄 적용 예정으로 기존 템플릿대로 비워주시면 감사하겠습니다.
    • 주요 integrations마다 친절하게 링크가 걸려있어 좋은 거 같습니다.
    • 긴 튜토리얼 파일인데 작업한다고 수고 많이 하셨습니다. 이미지 관련 내용만 확인 부탁드립니다.

[Title] 02-RAG-Advanced.ipynb
[Version] second
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"

검수팀의 요청사항에 따라 수정하였습니다.
@Jae-hoya Jae-hoya dismissed stale reviews from BAEM1N and LEE1026icarus via 992c05e January 9, 2025 17:44
BAEM1N
BAEM1N previously approved these changes Jan 10, 2025
Copy link
Member

@architectyou architectyou left a comment

Choose a reason for hiding this comment

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

🖥️ OS: mac
✅ Checklist

  • Template: Tutorials follows the required template.
  • Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
  • Image: Image filenames follow guidelines.
  • *Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
  • Code Execution: Code runs without errors.
  • Comments:
  1. 변수/함수/모듈명에 backtick을 사용하도록 되어 있는데, 파일명/폴더 명에도 적용해도되는지 모르겠습니다. Bold체로 변경해주심이 어떨까 싶습니다.
  2. libmagic 관련 오류가 발생합니다. 위에서 말씀주신 것 처럼 애플 실리콘 맥북에서 발생하는 문제인 것 같습니다.
image
  1. fastembed 파이썬 패키지가 없다고 나옵니다. -> 인프라팀에 추가 요청해주셔야 할 것 같습니다!
  2. create LLM 파트에서 huggingface model(flan-t5) 로드 시에 hf token이 필요합니다. 해당 내용도 함께 기입되면 좋을 것 같습니다.
  3. 인프라팀에서 수정해주실 것 같지만 파일 명이 03번이 되어야 할 것 같습니다..!

나머지 부분은 잘 동작합니다! 내용이 정말 많고 잘 정리되어 있는데 정말 고생하셨을 것 같습니다. ㅠㅠ 수고하셨습니다👍

architectyou
architectyou previously approved these changes Jan 10, 2025
[Title] 03-RAG-Advanced.ipynb
[Version] Third
[Language] ENG
[Packgage] "bs4", "faiss-cpu", "pypdf", "unstructured", "unstructured[pdf]", "chromadb", "rank_bm25", "langsmith", "langchain", "langchain_text_splitters", "langchain_community", "langchain_core", "langchain_openai", "langchain_experimental"

1. 파일 폴더명 backtick을 bold체로 바꾸었습니다.
3. 아고.. 인프라팀에 요청했는데, package에 적질 않았네요.. 수정하겠습니다.
4. You need a Hugging Face token to access LLMs on HuggingFace. 로 추가하였습니다.
5. 파일명 수정하였습니다.
@Jae-hoya Jae-hoya dismissed stale reviews from architectyou and BAEM1N via dc4677f January 10, 2025 13:32
@Jae-hoya
Copy link
Contributor Author

리뷰해주신 선형님 감사드립니다!

  1. 파일 폴더명 backtick을 bold체로 바꾸었습니다.
  2. 아고.. 인프라팀에 요청했는데, package에 적질 않았네요.. fastembed를 추가하였습니다.
  3. You need a Hugging Face token to access LLMs on HuggingFace. 로 추가하였습니다.
  4. 파일명 수정하였습니다.

@Jae-hoya Jae-hoya requested review from BAEM1N and architectyou and removed request for BAEM1N January 10, 2025 13:34
@Jae-hoya Jae-hoya changed the title [E-3] 12-RAG / 02-RAG-Advanced.ipynb [E-3] 12-RAG / 03-RAG-Advanced.ipynb Jan 10, 2025
architectyou
architectyou previously approved these changes Jan 10, 2025
Copy link
Member

@architectyou architectyou left a comment

Choose a reason for hiding this comment

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

확인했습니다! 고생 많으셨습니다!

Copy link
Contributor

@BAEM1N BAEM1N left a comment

Choose a reason for hiding this comment

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

🖥️ OS: Mac
✅ Checklist

  • Template: Tutorials follows the required template.
  • Table of Contents(TOC) Links: All Table of Contents links work. ((Yes/No)
  • Image: Image filenames follow guidelines.
  • Imports: All import statements use the latest versions. Ensure "langchain-teddynote" is not used.
  • from langchain_community.embeddings import HuggingFaceBgeEmbeddingsDeprecated되었습니다. 따라서 from langchain_huggingface import HuggingFaceEmbeddings으로 변경해야 할 거 같습니다. 또한 HuggingFaceBgeEmbeddings 클래스에서 사용되던 model_name의 기본 값이 더 이상 지원되지 않아 모델 이름을 명시해야 할 거 같습니다.
  • BaseRetriever.get_relevant_documents 또한 Deprecated되어 invoke()로 변경이 필요해 보입니다.
  • HuggingFaceHub 또한 Deprecated되어 langchain_huggingface.HuggingFaceEndpoint로 변경이 필요해 보입니다.
  • Code Execution: Code runs without errors.
  • Comments: {Write freely, 한국어 기술 가능}
  • WebBaseLoader 로더 사용 시 USER_AGENT 설정이 되어 있지 않아 경고가 출력되는 것으로 보이는데 set_env 단계에서 "USER_AGENT":"Mozilla/5.0 (compatible; langchain-opentutorial/1.0; +https://github.com/langChain-OpenTutorial/)" 이런 식의 추가가 있으면 좋을 거 같습니다.
    • USER_AGENT environment variable not set, consider setting it to identify your requests.

1. WebBaseloader 오류를 위해 .env에 user_agent추가.
If a warning is displayed due to the `USER_AGENT` not being set when using the WebBaseLoader,

please add `USER_AGENT = myagent` to the `.env` file.

문구를 추가하였습니다.

2. huggingface embedding 수정(디폴트모델((Default model: sentence-transformers/all-mpnet-base-v2)) 추가, from langchain_huggingface import HuggingFaceEmbeddings로 변경, )
3. from langchain_huggingface import huggingfaceendpoint모듈로 변경(이에맞게 모델도 "microsoft/Phi-3-mini-4k-instruct"로 변경)
4. get_relevance로 있던 요소 하나를 invoke로 수정.
@Jae-hoya
Copy link
Contributor Author

  1. WebBaseloader 오류를 위해 .env에 user_agent추가.
    If a warning is displayed due to the USER_AGENT not being set when using the WebBaseLoader,
    please add USER_AGENT = myagent to the .env file.
    문구를 추가하였습니다.

  2. huggingface embedding 수정하였습니다.
    (디폴트모델((Default model: sentence-transformers/all-mpnet-base-v2)) 추가, from langchain_huggingface import HuggingFaceEmbeddings로 변경,)

  3. from langchain_huggingface import huggingfaceendpoint모듈로 변경하였습니다.
    (이에맞게 모델도 "microsoft/Phi-3-mini-4k-instruct"로 변경)

  4. get_relevance로 있던 요소 하나를 invoke로 수정하였습니다.

Copy link
Contributor

@LEE1026icarus LEE1026icarus left a comment

Choose a reason for hiding this comment

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

다시 돌려봐도 문제 없이 잘 실행되었습니다.
수고하셨습니다.

@teddylee777 teddylee777 merged commit 78b90a0 into LangChain-OpenTutorial:main Jan 11, 2025
1 check failed
@sohyunwriter sohyunwriter added the docs tutorial label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs tutorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants