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

Modify regex #1236

Open
AInitikesh opened this issue Feb 8, 2025 · 1 comment
Open

Modify regex #1236

AInitikesh opened this issue Feb 8, 2025 · 1 comment
Labels
bug Bugs reported by users good first issue Good for newcomers

Comments

@AInitikesh
Copy link

ollama:deepseek-coder-v2
Generates code like bellow

 ```python
def add(a, b):
    if b == 0:
        return float('inf')  # Using infinity to avoid division by zero
    else:
        return a / b
add(1,0)

where there is space before ```python causing the output to be incorrect. Need to modify the lang_indicator as follows.

lang_indicator = r"^\s*```[a-zA-Z0-9]\s\n"

@srdas srdas added bug Bugs reported by users good first issue Good for newcomers labels Feb 8, 2025
@srdas
Copy link
Collaborator

srdas commented Feb 8, 2025

@AInitikesh Thanks for noticing this and raising the issue, as well as the proposed fix in magics.py. Why not open a PR with the correction, showing the problem first and the fix after the code change? Also test to make sure it does not break python code generation by other LLMs? Add screenshots as needed. You can use the Contributor documentation to set up for this: https://jupyter-ai.readthedocs.io/en/latest/contributors/index.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs reported by users good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants