Git Product home page Git Product logo

Comments (4)

mikkeyboi avatar mikkeyboi commented on April 28, 2024

Throwing some ideas out there, but an approach similar to using Kaggle might be worth looking into (API token as JSON file). If users can't load the token via an interactive widget, they can use environment variables to specify its path, and then proceed to download their datasets. If this works, it could be an alternative.

For Google Drive, maybe a method from OAuth2 can be used. Would it be reasonable to: run a cell, browser tab opens, credentials are entered, copy token and paste it back to the cell?

Another way (seems kinda hacky) is to use cookiestxt (https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg), by storing the authenticated session in your browser, uploading it to the Colab session, and loading the cookies when retrieving the files from Drive.

Edit: Seems like even if any of these methods work, you'll still need to have a window of your drive contents open and probably can't write to the drive. Maybe getting PyDrive or something similar to work is a better idea.
Edit2: Realized you basically said the same thing in the fastai forum post. I'm going to give that a try.

from swift-jupyter.

mikkeyboi avatar mikkeyboi commented on April 28, 2024

Have you tried using the method outlined by Conwyn here: https://forums.fast.ai/t/python-textfield-output-not-working/51000/12

from swift-jupyter.

marcrasi avatar marcrasi commented on April 28, 2024

Thanks for the ideas! There were some questions on the [email protected] mailing list about how to do this, so I just sent an email to the list letting everyone know that there are some new ideas here :)

from swift-jupyter.

philipturner avatar philipturner commented on April 28, 2024

I solved this problem! The solution was to allow Swift-Colab to switch between Swift mode and Python mode. In Python mode, execute the code that mounts Google Drive and uses an interactive text widget. Then, switch to Swift mode and restart the runtime. I was able to call %system ls "/content/drive/My Drive/Colab Notebooks" and it worked.

At the time of making this comment, my solution hasn't been implemented into upstream Swift-Colab yet. It will be possible by the 2.0 release, though.

from swift-jupyter.

Related Issues (16)

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.