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

Skip to content

Conversation

r14minji
Copy link
Contributor

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

Author Checklist

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

  • 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

@r14minji r14minji added the docs tutorial label Jan 21, 2025
@r14minji r14minji self-assigned this Jan 21, 2025
@r14minji
Copy link
Contributor Author

r14minji commented Jan 21, 2025

@samdaseuss 님, 새로 PR 열었습니다. 승인 다시 요청드릴게요. 감사합니다!
참고: #438

Copy link
Contributor

@changwonjeon changwonjeon left a comment

Choose a reason for hiding this comment

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

[Review Checklist]

  • Review OS: Windows

  • Template Rule 준수 여부: 이상없음

  • Table of Contents 링크 확인: 이상없음

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토: 해당없음

  • 최신 import 방식 사용 여부: 확인필요

    • 사용되지 않은 패키지가 import 되는 듯 하여, 확인이 필요합니다.
  • 코드 동작 확인: 오류발생

    • load_dataset에서 dataset 이름 처리에 오류가 있습니다. 제안드린 내용 살펴봐주시면 감사하겠습니다.
  • 제출 파일 확인: 이상없음

  • 기타 의견:
    LangSmith 연계하는 예제 작성하시느라 고생 많으셨습니다.
    앞에 03-HF-Upload.ipynb와 이어지는 내용이라,
    앞 내용에서 수정사항이 반영되지 않아서 그 부분에 대한 수정이 필요한 듯 합니다.
    또한, 윈도우11에서는 datasets 패키지를 설치해야 정상적으로 실행되었습니다.
    제안드린 내용 살펴봐주시고 수정 부탁드립니다.
    그리고, 김무상님 (@musangk)께서도 리뷰를 봐주시면 좋을 듯 합니다.
    저는 주로 윈도우환경에서 체크하기 때문에, 김무상님은 Linux 환경에서 리뷰하셔서 도움이 되시지 않을까 싶습니다.
    또한 김무상님께서는 03-HF-Upload.ipynb를 리뷰해주셔서, 연계성도 체크가 될 듯 합니다.
    감사합니다.

"\n",
"# Download dataset from HuggingFace Dataset using the repo_id\n",
"dataset = load_dataset(\n",
" LANGCHIN-OPENTUTORIAL/test-dataset, # Dataset name\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 부분이 03번과 연계되는데, 03번 수정된 사항이 반영이 안되었네요.
확인해주시고 수정해주실 수 있을까요?

저는 윈도우에서 코드 실행하는데,
경로를 제 기준에 맞게 수정하고 실행하면
LFS 오류가 나는데, 좀 확인이 필요한 듯 합니다.

저도 확인해볼테니, 같이 더블 체크하는게 좋을 듯 합니다.
혹시 뭔가 알게되시면 댓글 남겨주세요!

import pandas as pd
from datasets import load_dataset, Dataset
import os

# Download dataset from HuggingFace Dataset using the repo_id
dataset = load_dataset(
    "changwonjeon/rag-synthetic-dataset",  # Dataset name
    token=os.environ["HUGGINGFACEHUB_API_TOKEN"],  # Required for private datasets
)

# View dataset by split
huggingface_df = dataset["test_v1"].to_pandas()
huggingface_df.head()

NotImplementedError Traceback (most recent call last)
Cell In[16], line 6
3 import os
5 # Download dataset from HuggingFace Dataset using the repo_id
----> 6 dataset = load_dataset(
7 "changwonjeon/rag-synthetic-dataset", # Dataset name
8 token=os.environ["HUGGINGFACEHUB_API_TOKEN"], # Required for private datasets
9 )
11 # View dataset by split
12 huggingface_df = dataset["test_v1"].to_pandas()

File c:\Users\changwon\AppData\Local\pypoetry\Cache\virtualenvs\langchain-opentutorial-gDjqNHqk-py3.11\Lib\site-packages\datasets\load.py:2149, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
-> 2149 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2150 # Rename and cast features to match task schema
2151 if task is not None:
2152 # To avoid issuing the same warning twice

File c:\Users\changwon\AppData\Local\pypoetry\Cache\virtualenvs\langchain-opentutorial-gDjqNHqk-py3.11\Lib\site-packages\datasets\builder.py:1173, in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1171 is_local = not is_remote_filesystem(self._fs)
1172 if not is_local:
...
1177 "builder.download_and_prepare(), or use "
1178 "datasets.load_dataset() before trying to access the Dataset object."
1179 )

NotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Copy link
Contributor

Choose a reason for hiding this comment

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

위의 에러는 바로 위의 패키지를 재설치하면 됩니다.
다만, dataset 이름 설정은 수정되어야합니다.(03번 파일이 바뀌어서 따라가야합니다.)

Copy link
Contributor

Choose a reason for hiding this comment

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

"dataset_name = \"icarus1026/rag-synthetic-dataset\" #The part before the '/' is your Hugging Face username, and the part after the '/' is the name of the dataset you want to create.\n",

03-HF-Upload #421
창원님께서 말씀하신 03 파일은 위와 같이 수정되었습니다.
참고하시기 바랍니다.

추가로 저는 저의 hugging face dataset 경로 연결시 아래와 같이 데이터 잘 나왔습니다.

image

"metadata": {},
"outputs": [],
"source": [
"# %pip install -qU datasets"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"# %pip install -qU datasets"
"%pip install -qU datasets"

윈도우 환경에서는 위 패키지가 설치되어야하고, 커널 재시작이 필요합니다.
이에 관한 부가 설명이 좀 더 있으면 좋겠습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

독립 환경인 colab에서 실행 시에도 해당 커맨드 실행이 반드시 필요합니다.

Comment on lines 329 to 331
"# Download dataset from HuggingFace Dataset using the repo_id\n",
"dataset = load_dataset(\n",
" LANGCHIN-OPENTUTORIAL/test-dataset, # Dataset name\n",
Copy link
Contributor

@changwonjeon changwonjeon Jan 22, 2025

Choose a reason for hiding this comment

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

Suggested change
"# Download dataset from HuggingFace Dataset using the repo_id\n",
"dataset = load_dataset(\n",
" LANGCHIN-OPENTUTORIAL/test-dataset, # Dataset name\n",
"# Set dataset name (change to your desired name)\n",
"huggingface_id = " " # Your Hugging Face username(ID)\n",
"dataset_name = f"{huggingface_id}/rag-synthetic-dataset"\n",
"\n",
"# Download dataset from HuggingFace Dataset using the repo_id\n",
"dataset = load_dataset(\n",
" dataset_name, # Dataset name\n",

03-HF-Upload.ipynb에도 변경되었으니, 제안드린 내용을 참고하여 수정해야 실행이 됩니다.
이전에는 ""도 없어서 문자열 오류가 있으니 확인하시고 수정해주시면 감사하겠습니다.

Comment on lines 78 to 81
" \"langchain-anthropic\",\n",
" \"langchain_community\",\n",
" \"langchain_text_splitters\",\n",
" \"langchain_openai\",\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
" \"langchain-anthropic\",\n",
" \"langchain_community\",\n",
" \"langchain_text_splitters\",\n",
" \"langchain_openai\",\n",

위 4개 패키지는 아래 실행과 관련이 없는 듯 합니다.
4개 패키지 주석처리하고 실행하였는데, 오류없이 실행이 잘되었습니다.
확인 부탁드립니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

langchain_core 없이도 실행이 잘 되어서 같이 삭제해도 될 것 같습니다.

@fastjw fastjw requested a review from musangk January 22, 2025 13:23
Copy link
Contributor

@musangk musangk left a comment

Choose a reason for hiding this comment

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

[Review Checklist]

  • Review OS: Linux

    • Windows / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:

    • 별도로 남긴 리뷰들 확인 부탁드립니다. 🙏

Comment on lines 78 to 81
" \"langchain-anthropic\",\n",
" \"langchain_community\",\n",
" \"langchain_text_splitters\",\n",
" \"langchain_openai\",\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

langchain_core 없이도 실행이 잘 되어서 같이 삭제해도 될 것 같습니다.

"metadata": {},
"outputs": [],
"source": [
"# %pip install -qU datasets"
Copy link
Contributor

Choose a reason for hiding this comment

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

독립 환경인 colab에서 실행 시에도 해당 커맨드 실행이 반드시 필요합니다.

"\n",
"# Download dataset from HuggingFace Dataset using the repo_id\n",
"dataset = load_dataset(\n",
" LANGCHIN-OPENTUTORIAL/test-dataset, # Dataset name\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

"dataset_name = \"icarus1026/rag-synthetic-dataset\" #The part before the '/' is your Hugging Face username, and the part after the '/' is the name of the dataset you want to create.\n",

03-HF-Upload #421
창원님께서 말씀하신 03 파일은 위와 같이 수정되었습니다.
참고하시기 바랍니다.

추가로 저는 저의 hugging face dataset 경로 연결시 아래와 같이 데이터 잘 나왔습니다.

image

"\n",
"> Question - Retrieval\n",
"\n",
"![](./assets/langsmith-dataset-01.png)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

이번 PR에 이미지가 없는데, 이미지는 별도 PR로 추가되는 것이 맞을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR을 새로 여는 과정에서 누락되었습니다. 간단한 도표라 기존 것을 사용했었는데, 디자인팀에 신규로 요청드려두었고, 디자인 완료하는대로 반영해두겠습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

이번 PR에서 적용되는 건가요?
해당 내용이 적용되었을 때 approve를 남겨야 할지, 아니면 그전에 approve 해서 merge가 되어야 할지 싶어서요.

Copy link
Contributor

@musangk musangk left a comment

Choose a reason for hiding this comment

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

[Review Checklist]

  • Review OS: Linux

    • Windows / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:

    • 수정 적용해주셔서 전체적으로 막힘없이 잘 실행되었습니다. 👍
    • ipynb 파일 특성상 commit 나누기가 어려운데 너무 깔끔하게 나눠주셔서 보고 이해하는데 편했습니다. 💯
    • 추가로 남긴 불필요한 부분에 대한 삭제와 이미지에 대한 처리만 완료 된다면 approve 남기겠습니다. 꼼꼼하게 처리해주셔서 감사합니다.

}
],
"source": [
"import pandas as pd\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"import pandas as pd\n",

제가 기존에 놓친 부분 같습니다. pd도 사용되지 않는 것 같습니다.
확인하여 삭제 부탁 드립니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

적용 확인하였습니다. 감사합니다. 👍

"\n",
"> Question - Retrieval\n",
"\n",
"![](./assets/langsmith-dataset-01.png)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

이번 PR에서 적용되는 건가요?
해당 내용이 적용되었을 때 approve를 남겨야 할지, 아니면 그전에 approve 해서 merge가 되어야 할지 싶어서요.

@r14minji
Copy link
Contributor Author

r14minji commented Feb 2, 2025

@musangk 이미지 디자인 작업이 완료되어 추가했습니다. 신규 수정사항 pd 삭제도 완료했습니다! 꼼꼼히 리뷰해주셔서 감사합니다~🙇🏻‍♀️

musangk
musangk previously approved these changes Feb 2, 2025
Copy link
Contributor

@musangk musangk left a comment

Choose a reason for hiding this comment

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

[Review Checklist]

  • Review OS: Linux

    • Windows / Mac / Linux (해당 OS를 기재해주세요)
  • Template Rule 준수 여부:

    • Template Rule 가이드를 준수하였는가? (Check 표기)
  • Table of Contents 링크 확인:

    • Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
  • 이미지 파일명 검토:

    • 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
  • 최신 import 방식 사용 여부:

    • import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
  • 코드 동작 확인:

    • 모든 코드가 오류 없이 동작하는가? (Check 표기)
    • Warning 발생 시 코멘트에 적어주세요.
  • 제출 파일 확인:

    • 꼭 필요한 파일들만 제출되었는가?
      • 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
  • 기타 의견:

    • 빠른 수정 적용 감사합니다. 👍
    • 이미지도 잘 적용된 부분 확인하였습니다. 고생하셨습니다!! 🥇

Copy link
Contributor

@changwonjeon changwonjeon left a comment

Choose a reason for hiding this comment

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

[Review Checklist]

  • Review OS: Windows

  • Template Rule 준수 여부: 이상없음

  • Table of Contents 링크 확인: 중복 표기 확인 필요

    • 'Creating a LangSmith Dataset'으로 표기된 2곳이 있습니다. 확인 부탁드립니다.
  • 이미지 파일명 검토: 해당없음

  • 최신 import 방식 사용 여부: 수정 후 이상없음

  • 코드 동작 확인: 수정 후 이상없음

  • 제출 파일 확인: 이상없음

  • 기타 의견:
    이전에 리뷰하여 제안드린 부분 수정이 되었으며,
    코드 실행이 이상없이 실행되었습니다.
    다만, TOC에 'Creating a LangSmith Dataset'으로 표기된 곳이 2군데 있어서,
    수정 제안을 드렸으니 확인해주시면 되겠습니다.

"\n",
"- [Overview](#overview)\n",
"- [Environment Setup](#environment-setup)\n",
"- [Creating a LangSmith Dataset](#creating-a-langsmith-dataset)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"- [Creating a LangSmith Dataset](#creating-a-langsmith-dataset)\n",
"- [Creating a LangSmith Dataset](#creating-a-langsmith-dataset)\n",
"- [Creating Examples for LangSmith Dataset](#creating-examples-for-langsmith-dataset)\n",

코드 실행은 이상없이 잘 실행됩니다.
다만, ipynb에서 "Creating a LangSmith Dataset"가 2곳이 존재합니다.
그래서, 2번째 부분을 수정하면 어떨까 제안 드립니다.
그러면 TOC에서는 하나 추가가 됩니다.

"id": "fb68938f",
"metadata": {},
"source": [
"## Creating a LangSmith Dataset\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"## Creating a LangSmith Dataset\n",
""## Creating Examples for LangSmith Dataset\n",

여기를 수정하고, TOC에 추가하면 어떨런지 제안드립니다.
코드 실행하는 문제가 없으니 편하신대로 선택하시면 됩니다.

samdaseuss
samdaseuss previously approved these changes Feb 5, 2025
Copy link
Contributor

@samdaseuss samdaseuss 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/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, 한국어 기술 가능}
    수고하셨습니다 :)

@r14minji r14minji dismissed stale reviews from samdaseuss and musangk via ab162b2 February 5, 2025 12:31
@samdaseuss samdaseuss self-requested a review February 5, 2025 13:02
samdaseuss
samdaseuss previously approved these changes Feb 5, 2025
Copy link
Contributor

@samdaseuss samdaseuss 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/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, 한국어 기술 가능}
    수고하셨습니다 :)

@changwonjeon
Copy link
Contributor

@r14minji
안녕하세요. 리뷰어팀 전창원입니다.
제안한 의견 반영해주셔서 감사합니다.

현재 수정된 것으로 보니,
"Creating Examples for LangSmith Dataset"가 2개 중복이 나오는 듯 합니다. 😅

정리하자면 아래처럼 5가지로 구분되는게 맞지 않나 싶네요.
작성하신 구성이 섹션을 총 5개로 구성하셔서,
각각 다르게 제목이 필요하지 않나란 생각입니다.

제가 잘못 이해했다면 원래대로 하셔도 됩니다.
제 표현이 좀 부족했던 점 양해 부탁드립니다!

    "- [Overview](#overview)\n",
    "- [Environment Setup](#environment-setup)\n",
    "- [Creating a LangSmith Dataset](#creating-a-langsmith-dataset)\n",
    "- [Creating Examples for LangSmith Dataset](#creating-examples-for-langsmith-dataset)\n",
    "- [Creating a Dataset for LangSmith Testing](#creating-a-dataset-for-langsmith-testing)\n",

@r14minji
Copy link
Contributor Author

r14minji commented Feb 5, 2025

앗 아닙니다 제안해주신 부분이 더 적절하다고 생각해서 수정했는데, 제가 ipynb 파일 작성이 익숙하지 않아서 헷갈렸습니다ㅠ 목차-제목 5가지로 수정해서 커밋했습니다.

@samdaseuss samdaseuss self-requested a review February 5, 2025 13:55
Copy link
Contributor

@changwonjeon changwonjeon 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 b8f8d44 into LangChain-OpenTutorial:main Feb 8, 2025
1 of 2 checks passed
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.

5 participants