datawhalechina / llm-universe

本项目是一个面向小白开发者的大模型应用开发教程,在线阅读地址:https://datawhalechina.github.io/llm-universe/

Home Page:https://datawhalechina.github.io/llm-universe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问project运行了,但是选择gpt3.5-turbo访问不了

sdgahsdnrne opened this issue · comments

commented

之前notebook的gpt-3.5-turbo已经接入, 充值到OpenAI的帐号了, 可以正常访问

但是project中使用gpt-3.5模型出错:
1.开了vpn, project中的gradio一直等待
2.不开vpn, 则显示Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

请问怎么解决

commented

好吧,call_llm.py文件中get_completion_gpt的openai.api_key获取错误.
读取全局变量就好了
_ = load_dotenv(find_dotenv())
openai.api_key = os.environ['OPENAI_API_KEY']