gpt-4/bing doesn't work ... #9

オープン
manatlan2023-06-17 16:32:37 +09:00に作成 · 3件のコメント

Got :

  File "gpt4free/g4f/Provider/Providers/helpers/bing.py", line 181, in create
    'conversationSignature': conversationSignature,
UnboundLocalError: local variable 'conversationSignature' referenced before assignment

Seems that the first call returns garbage :

https://edgeservices.bing.com/edgesvc/turing/conversation/create

and so 'conversationSignature' is not initialized ;-(

Got : ``` File "gpt4free/g4f/Provider/Providers/helpers/bing.py", line 181, in create 'conversationSignature': conversationSignature, UnboundLocalError: local variable 'conversationSignature' referenced before assignment ``` Seems that the first call returns garbage : ``` https://edgeservices.bing.com/edgesvc/turing/conversation/create ``` and so 'conversationSignature' is not initialized ;-(
作成者

I've got a patch ;-)

just replace line 9 in gpt4free/g4f/Provider/Providers/helpers/bing.py

#import requests
from curl_cffi import requests

and it works like a charm ;-)

I've got a patch ;-) just replace line 9 in gpt4free/g4f/Provider/Providers/helpers/bing.py ~~#import requests~~ from curl_cffi import requests and it works like a charm ;-)
作成者

And here is a PR #10

And here is a PR https://gitler.moe/g4f/gpt4free/pulls/10

I applied the patch but still get an error

Traceback (most recent call last): File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 220, in asyncio.run(run(optionSet, config['messages'])) File "E:\AI\test\freegpt-webui-portable\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "E:\AI\test\freegpt-webui-portable\python\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 214, in run async for value in AsyncCompletion.create(prompt=messages[-1]['content'], File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 177, in create 'conversationSignature': conversationSignature, UnboundLocalError: local variable 'conversationSignature' referenced before assignment

I applied the patch but still get an error Traceback (most recent call last): File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 220, in <module> asyncio.run(run(optionSet, config['messages'])) File "E:\AI\test\freegpt-webui-portable\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "E:\AI\test\freegpt-webui-portable\python\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 214, in run async for value in AsyncCompletion.create(prompt=messages[-1]['content'], File "E:\AI\test\freegpt-webui-portable\g4f\Provider\Providers\helpers\bing.py", line 177, in create 'conversationSignature': conversationSignature, UnboundLocalError: local variable 'conversationSignature' referenced before assignment
サインインしてこの会話に参加。
ラベルなし
マイルストーンなし
プロジェクトなし
担当者なし
2 人の参加者
通知
期日
期日が正しくないか範囲を超えています。 'yyyy-mm-dd' の形式で入力してください。

期日は未設定です。

依存関係

依存関係が設定されていません。

リファレンス: g4f/gpt4free#9
説明はありません。