-
learning_langchain/multi_key_chat_open_ai.py为了避免 open_ai 的 limit 限制而做了轮训 api_key。 -
使用代理
使用
langchain时很方便,参考learning_langchain/multi_key_chat_open_ai.py使用
openai包有以下三种方法-
启动 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'
-
或直接设置代理
openai.proxy = os.environ['OPENAI_LOCAL_PROXY']
-
使用代理服务器:
api_base='https://api.openai-proxy.com/v1' openai.ChatCompletion.create( api_base=api_base, )
-
-
Notifications
You must be signed in to change notification settings - Fork 0
elevenching/learning-large-model
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published