GithubHelp home page GithubHelp logo

ryosukedtomita / langchaintest Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7 KB

LangChainをとりあえず使ってみるためにJupyter notebookとVSCocdeの環境を整える。

License: The Unlicense

Jupyter Notebook 92.73% Dockerfile 7.27%
docker jupyter-extension langchain-python vscode

langchaintest's Introduction

Setting up a Jupyter Notebook using a Docker container to use Lang Chain and access it through VS Code Jupyter extensions.

un license

INDEX


ABOUT

  • Lang Chain のチュートリアル をやってみるための環境構築をしました。
  • VSCode の Extensions で Jupyter Notebook を立ち上げ,Docker Container 内の Jupyter サーバーにアクセスして使用します。

LICENSE


un license


ENVIRONMENT


PREPARING


HOW TO USE

  1. edit .env to add your OpenAi API KEY
cat <<EOF >> .env
OPENAI_API_KEY="hogehoge"
EOF
Azure OpenAIを使う場合
cat <<EOF >> .env
OPENAI_API_VERSION=2023-12-01-preview
AZURE_OPENAI_ENDPOINT=https://example.com
AZURE_OPENAI_API_KEY=hogehoge
EOF
  1. run Docker container
docker compose up
lcel-container  | [I 2024-03-13 04:54:57.732 ServerApp]     http://127.0.0.1:8888/tree?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Open ./test.ipybn in VSCode Jupyter Extensions
  2. Select Kernel --> Select Another Kernel --> token 付きの URL を docker compose up の標準出力に表示されている URL を入力

ERROR LOG

raise HTTPError(403, "'_xsrf' argument missing from POST"

  • token を空にすると VSCode の Jupyter の Extension から kernel 指定時に xsrf エラーが出る。
# compose.yml
#command: jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root  --NotebookApp.password='' --NotebookApp.token=''
command: jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root  --NotebookApp.password=''

Azure OpenAI 使用時に BadRequestError: Error code: 400 OperationNotSupported The completion operation does not work が出る

  • model の種類を見ると,gpt-35-turbo は completion をサポートしていないので gpt-35-turbo-instruct に変更する。これは 2024/03/14 時点ではアメリカリージョンでしか使えない。

REFERENCE

langchaintest's People

Contributors

ryosukedtomita avatar

Stargazers

 avatar

Watchers

 avatar

langchaintest's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.