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

Inline completion failed on the server side: AttributeError: 'NoneType' object has no attribute 'ainvoke' #710

Closed
BwL1289 opened this issue Apr 1, 2024 · 4 comments · Fixed by #717
Assignees
Labels
bug Something isn't working

Comments

@BwL1289
Copy link

BwL1289 commented Apr 1, 2024

Description

After Enable Completions by Jupyternaut is enabled, I see the following error:

Inline completion failed on the server side

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/jupyter_ai/completions/handlers/base.py", 
line 130, in handle_request_and_catch await handle_request File "/usr/local/lib/python3.10/dist-packages/jupyter_ai/completions/handlers/base.py", 
line 158, in _handle_request await self.handle_request(request) File "/usr/local/lib/python3.10/dist-packages/jupyter_ai/completions/handlers/default.py", 
line 43, in handle_request suggestion = await self.llm_chain.ainvoke(input=model_arguments) AttributeError: 'NoneType' object has no attribute 'ainvoke'

Reproduce

  1. Install jupyter-ai
  2. Fire up a new server
  3. Click Enable Completions by Jupyternaut
  4. See error above

Expected behavior

Inline completion should work without issue

Context

  • Operating System and version: Amz Linux 2023
  • Browser and version: Chrome Version 122.0.6261.129
  • JupyterLab version: 4.1.2
  • JupyterAI version: 2.10.0
@BwL1289 BwL1289 added the bug Something isn't working label Apr 1, 2024
Copy link

welcome bot commented Apr 1, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@krassowski
Copy link
Member

Did you select a LLM? I think the problem is that the frontend should not send requests until a model is selected (and maybe print a nice error message in the notification).

@krassowski krassowski self-assigned this Apr 2, 2024
@BwL1289
Copy link
Author

BwL1289 commented Apr 2, 2024

That's it - thanks @krassowski. I think the nice error message "Please select an LLM" is sufficient to notify users they forgot to select a model.

Will close this issue. Appreciate the help.

@BwL1289 BwL1289 closed this as completed Apr 2, 2024
@krassowski
Copy link
Member

Reopening as it still needs fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants