Code Monkey home page Code Monkey logo

Comments (6)

freddyaboulton avatar freddyaboulton commented on June 23, 2024 1

I've modified the pdf github repo to be compatible with the latest gradio version. Opened #8386 to make some modifications to the guide.

from gradio.

cognitivetech avatar cognitivetech commented on June 23, 2024

ok, one last thing:

Do I need to gradio cc install before gradio cc dev?

In all the versions when I type gradio cc dev my output is like this:

% gradio cc dev   
♻ Launching demo/app.py in reload mode

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/cognitive/.pyenv/versions/3.11.5/lib/python3.11/site-packages/gradio/cli/commands/components/de │
│ v.py:83 in _dev                                                                                  │
│                                                                                                  │
│    80 │   )                                                                                      │
│    81 │                                                                                          │
│    82 │   if gradio_node_path.returncode != 0:                                                   │
│ ❱  83 │   │   raise ValueError(                                                                  │
│    84 │   │   │   "Could not find `@gradio/preview`. Run `npm i -D @gradio/preview` in your fr   │
│    85 │   │   )                                                                                  │
│    86                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                 app = PosixPath('demo/app.py')                                               │ │
│ │ component_directory = PosixPath('/Users/cognitive/github/gradio/guides/gradio_pdf/books')          │ │
│ │    gradio_node_path = CompletedProcess(args=['/usr/local/bin/node', '-e',                    │ │
│ │                       "console.log(require.resolve('@gradio/preview'))"], returncode=1,      │ │
│ │                       stdout=b'', stderr=b"node:internal/modules/cjs/loader:1227\n  throw    │ │
│ │                       err;\n  ^\n\nError: Cannot find module '@gradio/preview'\nRequire      │ │
│ │                       stack:\n-                                                              │ │
│ │                       /Users/cognitive/github/gradio/guides/gradio_pdf/books/frontend/[eval]\n     │ │
│ │                       at Module._resolveFilename                                             │ │
│ │                       (node:internal/modules/cjs/loader:1224:15)\n    at Function.resolve    │ │
│ │                       (node:internal/modules/helpers:190:19)\n    at [eval]:1:21\n    at     │ │
│ │                       runScriptInThisContext (node:internal/vm:209:10)\n    at               │ │
│ │                       node:internal/process/execution:118:14\n    at [eval]-wrapper:6:24\n   │ │
│ │                       at runScript (node:internal/process/execution:101:62)\n    at          │ │
│ │                       evalScript (node:internal/process/execution:136:3)\n    at             │ │
│ │                       node:internal/main/eval_string:51:3 {\n  code: 'MODULE_NOT_FOUND',\n   │ │
│ │                       requireStack: [\n                                                      │ │
│ │                       '/Users/cognitive/github/gradio/guides/gradio_pdf/books/frontend/[eval]'\n   │ │
│ │                       ]\n}\n\nNode.js v22.1.0\n")                                            │ │
│ │         gradio_path = '/Users/cognitive/.pyenv/versions/3.11.5/bin/gradio'                         │ │
│ │                host = 'localhost'                                                            │ │
│ │                node = '/usr/local/bin/node'                                                  │ │
│ │         python_path = '/Users/cognitive/.pyenv/versions/3.11.5/bin/python3'                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Could not find `@gradio/preview`. Run `npm i -D @gradio/preview` in your frontend folder.

ok, so it still doesn't work after I run gradio cc install but presumably I can install after changes and test from there... though hot-loading would be nice 🙏

from gradio.

cognitivetech avatar cognitivetech commented on June 23, 2024

ok, well.. I just realized I am trying to code with gradio_pdf which was released in january, so before cc became a module.

maybe I will try again from scratch with the newer code next time

from gradio.

freddyaboulton avatar freddyaboulton commented on June 23, 2024

Hi @cognitivetech ! Thanks for filing an issue and sorry for the trouble.

The five minute guide does not cover install because it is run as a part of create when building a new component. Seems like the issue stems from starting off of someone else's component. Will add a guide to cover that (or modify an existing guide).

BTW what do you mean by this - the --help flag already shows a general description of each command like you show.

Beyond that, general description of the commands listed on gradio cc --help woudl be super

Also the issue with @gradio/preview should not have anything to do with python 3.8. It's just that old components did not list it as a frontend dependency. Can you elaborate?

from gradio.

cognitivetech avatar cognitivetech commented on June 23, 2024

thanks freddy! i did find the gradio --help does work, later on.. so I deleted the first place mentioned on this issue, but failed to move from the other. I think I was just at my wits end trying a million different things. Maybe it was gradio --version, gradio -H or just gradio that wasn't giving me the information I wanted at that moment... but ultimately I was just tired and salty. :-)

I just had such high hope after beginning to work on your HF space, but trying to develop that cc gave me grief.

I look forward to getting to know this project better!

from gradio.

cognitivetech avatar cognitivetech commented on June 23, 2024

hey @freddyaboulton just a friendly ping.

if you even have some basic instructions to get me started developing the cc, that would be great!

keeping busy with backend issues, but I just hope to get an MVP up sooner than later, and don't want to search anew for some other frontend solution.

from gradio.

Related Issues (20)

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.