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
30.56k stars 2.27k forks source link

changing the prompt for image uploading in the Image object #8536

Closed branaway closed 1 week ago

branaway commented 2 weeks ago

Screen Shot 2024-06-12 at 12 40 09

I'd like to change the wording of the above prompt. Or is there already possible?

Thanks

abidlabs commented 1 week ago

Hi @branaway this is not possible within the core Gradio library as far as I know. However, you could this with a custom component!

we've made it possible for Gradio users to create their own custom components -- meaning that you can write some Python and JavaScript (Svelte), and publish it as a Gradio component. You can use it in your own Gradio apps, or share it so that anyone can use it in their Gradio apps. The great thing is that you can use existing components as a template, so you could make a new custom that is identical to the gr.Image in every way except that the wording is different.

If you'd like to create your own, we've put together a Guide: https://www.gradio.app/guides/five-minute-guide, and we're happy to help.

branaway commented 6 days ago

thank you @abidlabs for the advice. Can I assume that I can override any existing components by using them as the template?

branaway commented 6 days ago

Seemed to work. I got some errors though:

(.venv) bran-MBP|~/localProjects/gradio-components/myimage|⇒ gradio cc dev
â™» Launching demo/app.py in reload mode

Watching: '/Users/bran/localProjects/gradio-components/myimage/demo' 
'/Users/bran/localProjects/gradio-components/myimage/frontend',
'/Users/bran/localProjects/gradio-components/myimage'

Backend Server:  http://127.0.0.1:7861

Re-optimizing dependencies because vite config has changed

Failed to resolve dependency: svelte/animate, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/easing, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/internal, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/internal/disclose-version, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/motion, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/store, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte/transition, present in 'optimizeDeps.include'

Failed to resolve dependency: svelte, present in 'optimizeDeps.include'

Frontend Server (Go here): http://localhost:7862/

8:09:36 AM  ✨ new dependencies optimized: @gradio/atoms, @gradio/icons, @gradio/statustracker, @gradio/utils, @gradio/wasm/svelte, @gradio/upload, 
abidlabs commented 6 days ago

Hmm when you click on the frontend server link, does the image component show up?

branaway commented 6 days ago

showed up fine. These failures did not seem to impact the app.