tian-minghui / openai-style-api

支持将openai、claude、azure openai, gemini,kimi, 智谱AI,通义千问,讯飞星火API等模型服务方的调用转为openai方式调用。屏蔽不同大模型API的差异,统一用openai api标准格式使用大模型(Shield the differences between different large model APIs and use large models in a unified openai API standard format)
MIT License
328 stars 55 forks source link

尝试调整"top_p",解决qwen模型api转换时的bug #24

Open ldlsldls opened 4 months ago

ldlsldls commented 4 months ago

使用qwen时出现了一个bug 本来的model-config.json

[
    {
        "token":"qwen-1111222211",
        "type":"qwen",
        "config":{
            "api_key":"sk-xxxxxxxxxxxxxx",
            "model":"qwen-turbo"
        }
    }
]

使用chatnext image 结果

image

bug

{"code":"InvalidParameter","message":"Range of top_p should be (0.0, 1.0)","request_id":"7dc1df54-850d-95c8-bbdf-07112f62c90e"}

看到tian-mh其他的config里面设置了"top_p" 我也设置一下,像他一样"top_p": 0.7

[
    {
        "token":"qwen-1111222211",
        "type":"qwen",
        "config":{
            "api_key":"sk-xxxxxxxxxxxxxxxxxxxxx",
            "model":"qwen-turbo",
            "top_p": 0.7
        }
    }
]

结果 image

我尝试了0.1,0.2,...,0.9, 都可以, 也许是自动归一化吧, 当然就选0.7折中一点

最后十分感谢作者的这个项目, 帮了大忙, 可以用国内的api连接zotero gpt了🌸🌸🌸🌸🌸🌸🌸

tian-minghui commented 4 months ago

top_p的问题,我一会调整下, 下边是说调整成0.7之后,qwen变成gpt了?