GiusTex / EdgeGPT

Extension for Text Generation Webui based on EdgeGPT, a reverse engineered API of Microsoft's Bing Chat AI
126 stars 5 forks source link

Exception Error coming #3

Closed TruthSearchers closed 1 year ago

TruthSearchers commented 1 year ago

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/EdgeGPT.py", line 329, in init self.struct = response.json() File "/usr/local/lib/python3.10/dist-packages/httpx/_models.py", line 756, in json return jsonlib.loads(self.text, **kwargs) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1299, in process_api result = await self.call_function( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1036, in call_function prediction = await anyio.to_thread.run_sync( File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, *args) File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 488, in async_iteration return next(iterator) File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/modules/chat.py", line 247, in cai_chatbot_wrapper for history in chatbot_wrapper(text, state): File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/modules/chat.py", line 174, in chatbot_wrapper prompt = apply_extensions('custom_generate_chat_prompt', text, state, *kwargs) File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/modules/extensions.py", line 94, in apply_extensions return EXTENSION_MAP[typ](args, kwargs) File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/modules/extensions.py", line 69, in _apply_custom_generate_chat_prompt return custom_generate_chat_prompt(text, state, kwargs) File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/extensions/EdgeGPT/script.py", line 168, in custom_generate_chat_prompt asyncio.run(EdgeGPT()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/content/drive/.shortcut-targets-by-id/1-aH56S1YRqDNMZxOYbQG7vIqxXro3ZRl/text-generation-webui/extensions/EdgeGPT/script.py", line 156, in EdgeGPT bot = Chatbot(cookie_path='extensions/EdgeGPT/cookies.json') File "/usr/local/lib/python3.10/dist-packages/EdgeGPT.py", line 583, in init _Conversation(self.cookies, self.proxy), File "/usr/local/lib/python3.10/dist-packages/EdgeGPT.py", line 331, in init raise Exception( Exception: Authentication failed. You have not been accepted into the beta.

This the error i am facing when i use Hey Bing command i also check i am authenticated by microsoft to use bing chat still error coming

GiusTex commented 1 year ago

So you can use Bing chat? Maybe you need to export again the cookies, one time it happened to me too, and exporting and pasting new cookies in the json file solved my error

TruthSearchers commented 1 year ago

I tried it actually it don't work with edge browser cookies , only working with chrome and Firefox (That i solved it like this )

Also facing two more problem ,

1) it suddenly stopping without completing full para like stop in line 1 etc incomplete many times not all the time (max_tokens at 1000) 2) it's not working with character like i asked what's the date today character one given reply Feb 13 i don't know why It's working normally

GiusTex commented 1 year ago

Uhm, I don't know how Bing can work with chrome/firefox cookies, but good to hear. For the sudden stop there are errors or something I can see? And for the answer, the hour ecc, have you turned on the option to show Bing output, to see what did he say you? If the Bing answer is right but the model one not, I don't know, maybe you need to change the Bing context, it's one of the weaknesses until I have time to find out the cause

TruthSearchers commented 1 year ago

No errors for stopping it just stop in middle (but it's happening many times )

Ok i will try with Bing output one (didn't tried yet ) (Didn't changed any context just as it is )

GiusTex commented 1 year ago

Maybe the code works with any cookies but the bing chatbot using wrong cookies can't generate an answer, and so the character doesn't have the info. But I have to see the Bing output to understand

TruthSearchers commented 1 year ago

I checked it Bing output giving correct date But character not giving correct date

What can be the reason

I checked it ,it only coming with character i don't know what causing it

TruthSearchers commented 1 year ago

I tried it found it because of context of character ,it's not responding correct

There is only one more problem left which is it stop in middle , sometimes it not even complete Just only that problem I also checked by turning it off if some problem other than extension code , it worked fine no problem at all (no stoping )

(It only occuring to the Bing one )

Also when i click on Bing output check (it write completely)

GiusTex commented 1 year ago

Maybe you have a too long context or chat history? Use the example character, Yamada, reset her history, tell me what happens. Ask her 2-3 things (what day is, what hour is, ecc)

TruthSearchers commented 1 year ago

I checked it problem of not showing correct replies was context ,it solved yesterday told you in chat before

Only problem left it stop in middle automatically without completing , reason unknown (Bing output when i check it ) (it not stopping in middle) When i didn't not check that checkbox it stop in middle almost everytime without completing

GiusTex commented 1 year ago

I think that's related to this issue; as they say there, try reducing max_new_tokens. Maybe you can find other similar issues here, like the one above

TruthSearchers commented 1 year ago

I don't think this is a problem because my token are around 400-500 This problem not occuring with regular model Only when i use edgegpt ,without it ,it running without any problem

GiusTex commented 1 year ago

Uhm. Can you anyway reset Yamada example character and ask 2-3 things? To understand

GiusTex commented 1 year ago

If you still have errors you can open again this issue, or open a new one

TruthSearchers commented 1 year ago

Oops forgot to reply it actually i found it ,it's because of model i am using no problem in code I tried different model and it worked fine

Thanks for help

GiusTex commented 1 year ago

Glad to hear that!