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

Unable to run %%ai in Glue Notebook #1196

Open
ahlag opened this issue Jan 10, 2025 · 2 comments
Open

Unable to run %%ai in Glue Notebook #1196

ahlag opened this issue Jan 10, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ahlag
Copy link

ahlag commented Jan 10, 2025

Description

I am getting UsageError: %%ai is a cell magic, but the cell body is empty. Did you mean the line magic %ai (single %)? when I ran %%ai in a Glue Notebook.

Screenshot 2025-01-11 at 1 10 37

Reproduce

Just run in a Glue Notebook

%%ai chatgpt 
tell me a joke

Expected behavior

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@ahlag ahlag added the bug Something isn't working label Jan 10, 2025
@srdas
Copy link
Collaborator

srdas commented Jan 13, 2025

@ahlag I am not able to reproduce your error in the current version of Jupyter AI, everything seems to work as intended with the %%ai chatgpt magic. Though I have not tried a Glue notebook, as I need to set up access for that. Can you try a few things to see if they work?

There are similar issues with JupyterLab magics and sometimes it is resolved by trying to add a return before or after the
"tell me a joke" (which should be on a separate line from the first one). See for example this version of your error:
image
(There may be a missing newline/return in your Glue notebook.)

If this does not work, can you try using the full model id to see if that works?
%%ai openai-chat:gpt-3.5-turbo (instead of %%ai chatgpt)

Finally, reinstall Jupyter AI and load magics in your Glue notebook:

  • pip install jupyter-ai
  • pip install jupyter-ai-magics (just to be sure)
  • pip install langchain-openai
  • %load_ext jupyter-ai-magics
    Now try your magics again.

More Reference: https://docs.aws.amazon.com/glue/latest/dg/interactive-sessions-magics.html

@ahlag
Copy link
Author

ahlag commented Jan 14, 2025

@srdas Reached out internally in Amazon.

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

No branches or pull requests

2 participants