Giter VIP home page Giter VIP logo

Comments (5)

peteut avatar peteut commented on July 19, 2024

Hmm, there should be no size limitation from FileReader. Sorry, I have no explanation for that behaviour yet.
Could you please provide a pip freeze | grep ipywidgets?
For now you could try/use the builtin upload feature of notebook.

from ipython-file-upload.

ialek36 avatar ialek36 commented on July 19, 2024

In my case files larger than ~10Mb do not get uploaded. I used the code sample for README.md, with small modifications. The _cb method doesn't get called at all. It works for smaller files.

(tensorflow) bash-3.2$ pip freeze | grep ipywidgets
ipywidgets==7.3.1
import io
from IPython.display import display
import fileupload

def _upload():

    _upload_widget = fileupload.FileUploadWidget()

    def _cb(change):
        print("hello")
        filename = change['owner'].filename
        print('Uploaded `{}` ({:.2f} kB)'.format(
            filename, len(change['owner'].data) / 2 **10))

    _upload_widget.observe(_cb, names='data')
    display(_upload_widget)

_upload()

from ipython-file-upload.

harmvanderheijden avatar harmvanderheijden commented on July 19, 2024

I'm seeing exactly the same issue as ialek36. Running on Python3, Windows 10, ipywidgets 7.0.0, using the README.md code sample (modified to remove the ioStringIO line, seems not compatible with Python 3). Uploading works fine for smaller files (~100 kB, 4 MB), but hangs (without ever calling _cb) for files > ~10 MB. Please let me know if I can help debug.

from ipython-file-upload.

ialek36 avatar ialek36 commented on July 19, 2024

I was actually able to track this down to tornado package. It has websocket.py module which in turn has a setting _default_max_message_size = 10 * 1024 * 1024. That controlled the file size upload for me.

from ipython-file-upload.

michcio1234 avatar michcio1234 commented on July 19, 2024

Thanks @ialek36 for this trace.
So to actually modify this setting one has to either:

  • run jupyter with following option:
    jupyter notebook --NotebookApp.tornado_settings='{"websocket_max_message_size": 62914560}'
    (the magic number above is 60 * 1024 * 1024, i.e. 60 MiB)

  • or to create jupyter config file as described here and uncomment and set c.NotebookApp.tornado_settings option.

from ipython-file-upload.

Related Issues (19)

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.