Closed branaway closed 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.
thank you @abidlabs for the advice. Can I assume that I can override any existing components by using them as the template?
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,
Hmm when you click on the frontend server link, does the image component show up?
showed up fine. These failures did not seem to impact the app.
I'd like to change the wording of the above prompt. Or is there already possible?
Thanks