Git Product home page Git Product logo

jupyter-translate's People

Contributors

ehultee avatar romankuzmin404 avatar wittmannf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jupyter-translate's Issues

SyntaxError trying run file

Hi ! I cloned your repo and tried run python jupyter_translate.py playground.ipynb --languaje 'en' and I got the following error

File "/home/rvcristiand/Documents/jupyter-translate/jupyter_translate.py", line 23 list_to_gen = lambda: [(yield x) for x in replacement_list] ^ SyntaxError: 'yield' inside list comprehension

'NoneType' object has no attribute 'group' in jupyter_translate.py

Description:

Issue Summary:

When running the testpython jupyter_translate.py 01_intro.ipynb --language 'pt' command with the provided script jupyter_translate.py, I encountered an AttributeError: 'NoneType' object has no attribute 'group' error. The error occurs in the context of using regular expressions and the group attribute, but I'm having difficulty pinpointing the exact source of the issue.

Steps to Reproduce:

  1. Run the following command in the terminal:
    testpython jupyter_translate.py 01_intro.ipynb --language 'pt'
    

Expected Behavior:

I expected the script to execute without errors and successfully translate the Jupyter Notebook content into the specified language.

Actual Behavior:

The script encountered an AttributeError: 'NoneType' object has no attribute 'group' error during execution.

Error Stack Trace:

Traceback (most recent call last):
  File "jupyter_translate.py", line XXX, in jupyter_translate
    ...
    result = match.group()
AttributeError: 'NoneType' object has no attribute 'group'

Code Snippet:

Here's the relevant portion of the code where the error occurs:

# ... (other code)
# Inside jupyter_translate function

# ...
if cell['cell_type'] == 'markdown':
    if source[:3] == '```':
        skip_row = not skip_row  # Invert flag until I find next code block

    if not skip_row:
        if source not in ['```\n', '```', '\n'] and source[:4] != '<img':
            # The following line is where the error occurs
            data_translated['cells'][i]['source'][j] = translate_markdown(source, dest_language=language)
# ... (other code)

Additional Information:

  • Python version: 3.9.16
  • Operating System: mac

Add loader.

Hey Man, i uses to transplante fast ai todo. It's working fine así i can see. I would just add a loader. Like printing the total numbers of cells AND the cell by cell like
Translating cell 3 of 192 etc etc.
I didnt think it was working until i added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.