Sorry Bro

#1
by LeroyDyer - opened

when will you release the gradio docs in json format my friend : and keep them updated so we can train on these dos : as currently i use Artifacts to produce my gradio interfaces as it is the best for this :
there are some very complexed tasks whoich even i get stuck on . such as making dynamic boxes etc , hiding and reapearing components etc :

as well as i have noticed after lots of interaction it also changed the way it wa making the interfaces for me now :

        
    def create_media_components(self):
        """Create reusable media upload components"""
        with gr.Accordion("Media Upload", open=False):
            with gr.Row():
                audio_input = gr.Audio(
                    sources=["upload"],
                    type="filepath",
                    label="Upload Audio"
                )
                image_input = gr.Image(
                    sources=["upload"],
                    type="filepath",
                    label="Upload Image"
                )
                video_input = gr.Video(
                    sources=["upload"],
                    label="Upload Video"
                )
        return audio_input, image_input, video_input
    
    def create_chat_components(self):
        """Create reusable chat components"""
        chatbot = gr.Chatbot(type="messages", elem_id="chatbot", label="Chat History")
        text_input = gr.Textbox(
            placeholder="Enter text here...",
            show_label=False,
            container=False
        )
        return chatbot, text_input
     
    def create_control_buttons(self):
        """Create reusable control buttons"""
        with gr.Row():
            submit_btn = gr.Button("Submit", variant="primary")
            stop_btn = gr.Button("Stop", visible=False)
            clear_btn = gr.Button("Clear History")
            new_chat_btn = gr.Button("New Chat")
        return submit_btn, stop_btn, clear_btn, new_chat_btn
     

ie to use like this :


            # Output section
            with gr.Row():
                with gr.Column():
            

                    chatbot, text_input = self.create_chat_components()

                with gr.Column():
                    gr.Markdown("<center><h1>Code Artifacts</h1></center>")
                    code.render()
            with gr.Row():
                    # Media upload section
                    audio_input, image_input, video_input = self.create_media_components()

which is very organized as you can create sections of your interface and import them into the right places etc :

So perhaps a load of examples (spaces) as ell should be included : for many simple and complexed tasks :
there is a lot can be done with gradio but not enough documentation to explain very important concepts :
Even the plugin design is tricky bro !
Pleasse assist !

thanks !

also very good gradio thingy !!

Hi @LeroyDyer ! It seems that there are two points here: Having the gradio docs in a format that’s easily consumed by LLMs (txt/json) and a way to place gradio components defined in other files anywhere in a Gradio application’s UI.

Can you clarify if I misrepresented your message?

yes the doc in llm format is important :

also : you hit it right again : there are so many things that can be done with gradio we did not scratch the surface yet : now i know a lot more about using it ; i can watch the plugin video you made again and maybe be able to decypher it :

With regards to placing components in specific positions and orders i will say its not easy : hence i shared the code to show you how i finally managed to get the model to explain it to me :

I made a mini colab app with multiple code boxes which can be added or removed , as well as made a tool box where i could load and unload tools as well as create them on the fly updating the interface .... so the interface can be updated live .. but it was a long journey to discover how as well as the model when editing my interfacs kept changing the code for the worst as there was no points of reffeence on how to dynamically add boxes or remove boxes etc at runtime ... so set of tutorials would probably be apreciated as i think maybe people do find it quite hard with gradio .. and prefer streamlit ... but personally i only use gradio !

so now i have some components created as you see in functions that become reusable in other interfaces and now they are easier to import making my interfaces quicker to construct !

Your docs on hugging face are very glitchy and this is because gradio does not like to have many verisons of itself on a single webpage so it locks up ... but works very well as a single or tabbed interface ! i dont need to tell you this either !

any way sorry for the post as there is no messaging feature ... and i wanted to tell you this ... but you probably new all these ways to implement already lol ( i just discovered )...

thanks and again very great work !

LeroyDyer changed discussion status to closed

Sign up or log in to comment