Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure配置好之后运行报错 #347

Closed
huangxiangdan opened this issue Oct 21, 2023 · 10 comments
Closed

azure配置好之后运行报错 #347

huangxiangdan opened this issue Oct 21, 2023 · 10 comments

Comments

@huangxiangdan
Copy link

日志如下:
问题:查一下吴江五等于几? 以下是小爱的回答: 这个小爱还在学习呢,不如你问我,你会做什么,先了解一下我的功能吧 以下是 CHATGPTAPI 的回答: [10/21/23 22:11:19] DEBUG Edge TTS with voice=zh-CN-XiaoxiaoNeural xiaogpt.py:347 ERROR 'ChatGPTBot' object has no attribute 'deployment_id' xiaogpt.py:391

抱歉因为不熟悉python,没法直接提pr。

if openai.api_type == "azure": kwargs["deployment_id"] = self.deployment_id
改为
if openai.api_type == "azure": kwargs["deployment_id"] = self.default_options["engine"]
即可正常运行。

所以此处应该是个bug。麻烦修复下。
另外给使用azure的同学做个参考:
--deployment_id gpt-35-turbo(直接命名为model_name,这样各种api兼容性比较好) --api_base https://xxx(resource_name).openai.azure.com 这样使用即可

@yihong0618
Copy link
Owner

谢谢,我们更新下

cxjava added a commit to cxjava/xiaogpt that referenced this issue Oct 30, 2023
frostming pushed a commit that referenced this issue Oct 30, 2023
@cxjava
Copy link
Contributor

cxjava commented Oct 30, 2023

azure base url 是类似这样的https://xxxx-bbbb.openai.azure.com/

Snipaste_2023-10-30_11-03-39

如何找到deployment_id:

Snipaste_2023-10-30_11-03-59

如下的deployment_id是 gpt-test:

Snipaste_2023-10-30_11-07-28

那么配置文件应该设置为:

{
  "hardware": "LX06",
  "account": "",
  "password": "",
  "glm_key": "",
  "bard_token": "",
  "serpapi_api_key": "",
  "cookie": "",
  "mi_did": "",
  "use_command": false,
  "mute_xiaoai": true,
  "verbose": false,
  "bot": "chatgptapi",
  "enable_edge_tts": false,
  "edge_tts_voice": "zh-CN-XiaoxiaoNeural",
  "prompt": "请用100字以内回答",
  "keyword": ["请问"],
  "change_prompt_keyword": ["更改提示词"],
  "start_conversation": "开始持续对话",
  "end_conversation": "结束持续对话",
  "stream": false,
  "proxy": "",
  "gpt_options": {},
  "bing_cookie_path": "",
  "bing_cookies": {},
  "openai_key": "abcdefg",  👈㊙️
  "api_base": "https://xxxx-bbbb.openai.azure.com/", 👈㊙️
  "deployment_id": "gpt-test", 👈㊙️
  "localhost": true
}

@jingtaozhang18
Copy link

image 启动之后,没有收到GPT的回答,请问如何看一下日志,是哪里出错了

@yihong0618
Copy link
Owner

—verbose

@jingtaozhang18
Copy link

image 添加这个日志之后,并没有说哪里出了问题,卡在了xiaogpt.py:64

@jingtaozhang18
Copy link

我已经可以在本地通过直接请求Azure Open AI的API接口
image

@jingtaozhang18
Copy link

可能是我的网络问题,今天早上可以运行成功了

@yihong0618
Copy link
Owner

可能是我的网络问题,今天早上可以运行成功了

好的

@Saintoliver
Copy link

Saintoliver commented Apr 18, 2024

azure base url 是类似这样的https://xxxx-bbbb.openai.azure.com/

Snipaste_2023-10-30_11-03-39 # 如何找到deployment_id: Snipaste_2023-10-30_11-03-59 # 如下的deployment_id是 `gpt-test`: Snipaste_2023-10-30_11-07-28 那么配置文件应该设置为:
{
  "hardware": "LX06",
  "account": "",
  "password": "",
  "glm_key": "",
  "bard_token": "",
  "serpapi_api_key": "",
  "cookie": "",
  "mi_did": "",
  "use_command": false,
  "mute_xiaoai": true,
  "verbose": false,
  "bot": "chatgptapi",
  "enable_edge_tts": false,
  "edge_tts_voice": "zh-CN-XiaoxiaoNeural",
  "prompt": "请用100字以内回答",
  "keyword": ["请问"],
  "change_prompt_keyword": ["更改提示词"],
  "start_conversation": "开始持续对话",
  "end_conversation": "结束持续对话",
  "stream": false,
  "proxy": "",
  "gpt_options": {},
  "bing_cookie_path": "",
  "bing_cookies": {},
  "openai_key": "abcdefg",  👈㊙️
  "api_base": "https://xxxx-bbbb.openai.azure.com/", 👈㊙️
  "deployment_id": "gpt-test", 👈㊙️
  "localhost": true
}

请问大佬是否要先注册,成功获取Create Azure OpenAI的服务?我每次都卡在了price tier 上了。每次申请都被拒掉,已经被拒了四次了。。。请问有何种技巧可以申请通过。
image

@Saintoliver
Copy link

Saintoliver commented Apr 21, 2024

自问自答,已经找到了方案。

https://zhuanlan.zhihu.com/p/674880947

https://www.cnblogs.com/qsing/p/17362395.html

重要的是要用教育邮箱申请成功率高,前几次都是用一般邮箱申请,被驳回了5次。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants