Skip to content

elevenching/learning-large-model

Repository files navigation

Learning Large Model

环境

  • learning_langchain/multi_key_chat_open_ai.py 为了避免 open_ai 的 limit 限制而做了轮训 api_key。

  • 使用代理

    使用 langchain 时很方便,参考 learning_langchain/multi_key_chat_open_ai.py

    使用 openai 包有以下三种方法

    1. 启动 jupyter notebook 设置代理:

      jupyter notebook --generate-config

      生成配置文件 ~/.jupyter/jupyter_notebook_config.py,在文件中添加如下配置:

      import os
      os.environ['HTTP_PROXY'] = 'http://127.0.0.1:xxxx'
      os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:xxxx'
    2. 或直接设置代理

      openai.proxy = os.environ['OPENAI_LOCAL_PROXY']
    3. 使用代理服务器:

      api_base='https://api.openai-proxy.com/v1'
      openai.ChatCompletion.create(
          api_base=api_base,
      )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published