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

Script fails to return answer and crashes #1

Open
AdrianoWanderlingh opened this issue Dec 12, 2022 · 0 comments
Open

Script fails to return answer and crashes #1

AdrianoWanderlingh opened this issue Dec 12, 2022 · 0 comments

Comments

@AdrianoWanderlingh
Copy link

Python 3.8.10
Ubuntu 20.04.5 LTS


log:

Welcome to Wikipedia GPT-3 Bot. Ask any question.

(wikibot) who is jesus?
Traceback (most recent call last):
File "main.py", line 196, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "main.py", line 191, in main
await answer_question(question)
File "main.py", line 153, in answer_question
page_search_query = await question_to_page_search_query(question)
File "main.py", line 61, in question_to_page_search_query
return await gen_completion(prompt)
File "main.py", line 48, in gen_completion
return sanitize_response((await resp.json())["choices"][0]["text"])
KeyError: 'choices'

program ends

Any idea on what may trigger this behaviour?

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

1 participant