gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.41k stars 2.53k forks source link

4.0 beta tracking + feedback #5564

Closed freddyaboulton closed 11 months ago

freddyaboulton commented 1 year ago

Place to track all of the bugs, nits, and comments found in the 4.0 branch (v4)

Pre launch

Nice to have

Definitely post launch

freddyaboulton commented 1 year ago

Thoughts on creating my first custom component:

Can we create single-file templates for common components? It's kind of jarring to see so many different files when you're just getting started.

abidlabs commented 1 year ago

Allow authors to choose the package name. Right now, it defaults to the class name.

If we're referring to the python package, perhaps the default could be gradio-{component_name}. This is less likely to already exist on pypi and can make finding gradio-related packages easier

ImportError: cannot import name 'RootModel' from 'pydantic' (/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydantic/__init__.cpython-311-darwin.so)
image

In my case, my app was raising a ValueError in the python code

abidlabs commented 1 year ago

From @aliabid94:

duerrsimon commented 1 year ago

Great work so far!

Few questions here that remain after the demo yesterday:

Will be working on a few components now to test stuff more:

abidlabs commented 1 year ago

Thanks @duerrsimon for this feedback!

What's the best way to integrate another CSS framework like tailwind in the build process? I'd prefer to have multiple components all use the same stylesheet generated by tailwind and not include tailwind multiple times so I guess it would make sense if one could add some global front-end dependencies. I think tailwind supports project set up as monorepos but I am no expert in this.

Tailwind doesn't play well with Gradio themes. I think the better approach would be to use the CSS variables that are also used in the core Gradio components. You can take a look at existing Gradio components to see how to use the CSS variables. Generally, it looks like this: var(--checkbox-border-color-focus). We'll also document these better (cc @hannahblair @pngwn)

Right now looks like all customcomponents will have to be in Svelte, no? Or will it be possible to use e.g React or Vue at a later point as well?

We'll probably stick to Svelte. Even though I'm primarily backend engineer who tries to stay away from frontend as much as possible, I'll say that the learning curve for Svelte is particularly nice (way easier to pick up than React imo). I've added some resources for learning Svelte to our guide: https://github.com/gradio-app/gradio/wiki/Guide-to-Custom-Components-(Beta)

Gradio uses @gradio/icons for some icons. Would be great to indicate open icon libraries with similar style so that the iconography stays somewhat consistent

@pngwn do you have any thoughts on this?

abidlabs commented 1 year ago

Oh it looks like @hannahblair is already addressing the first point in this PR: https://github.com/gradio-app/gradio/pull/5750!

freddyaboulton commented 1 year ago

Looking forward to the new components @duerrsimon! Thanks for the comments/questions.

freddyaboulton commented 12 months ago

https://github.com/gradio-app/gradio/assets/41651716/1fa978e6-ca8e-4574-87e9-cb30d1882a8f

EDIT: Using this to store assets lol

Uploading PDFDemo.mov…

freddyaboulton commented 11 months ago

Did pretty much all of this. Converted the remaining TODOs to issues and added the custom-components label.

Thanks again for the feedback @duerrsimon !