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

Generate command can create sections with no code cells (no retry logic) #259

Open
JasonWeill opened this issue Jul 10, 2023 · 3 comments
Open
Labels
bug Something isn't working @jupyter-ai/magics project:generate File generation flow

Comments

@JasonWeill
Copy link
Collaborator

Description

The /generate command in the chat UI can generate a notebook with no code cells, or with empty code cells where code was expected. You can see this in the sample PyTorch notebook from #90: https://github.com/jupyterlab/jupyter-ai/blob/96465d1df60a9b3be592220489f78fa59e430fd0/examples/generate/Training%20Dense%20Neural%20Network%20with%20PyTorch.ipynb

This is still possible when using Dask (see #242, #244).

Expected behavior

If code is expected, add retry logic when generating code cells.

Context

Jupyter AI version 0.9.0 (with #244 applied).

@JasonWeill JasonWeill added bug Something isn't working @jupyter-ai/magics labels Jul 10, 2023
@JasonWeill JasonWeill added the project:generate File generation flow label Jul 18, 2023
@JasonWeill JasonWeill added this to the 2.2.0 Release milestone Jul 28, 2023
@cbonnett
Copy link

cbonnett commented Aug 30, 2023

If anyone is interested. I've generated 2 notebooks and all code cells are empty.
I can see in the terminal that code was produced but the notebook just has Mardown and empty code cells.
Not an urgent issue for me at all, just thought it might be helpful for this issue.
Screenshot 2023-08-30 at 17 26 13

@3coins
Copy link
Collaborator

3coins commented Aug 30, 2023

@cbonnett
Thanks for reporting this issue. It seems like you are have reported this issue with 0.9.0 which is an older version. Were you able to reproduce with the latest Jupyter AI versions?

It will also be helpful to know which language model was selected for this generate command.

@cbonnett
Copy link

cbonnett commented Aug 31, 2023

@3coins

I think I have latest version:

pip show jupyter_ai
Name: jupyter_ai
Version: 2.1.0

I am using GPT-4.

Think I figured out the problem, not yet confirmed though.
GPT-4 is very chatty, even if you ask it to return just code, it will often say:

Here is your code:
""""
code...
""""

So I suspect doing some regex to catch the code from the string would fix the problem.

The problem is not there if use GPT-3.5 btw GP3.5 is less chatty compared to GPT-4.

@JasonWeill JasonWeill removed this from the 2.3.0 Release milestone Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @jupyter-ai/magics project:generate File generation flow
Projects
None yet
Development

No branches or pull requests

3 participants