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.69k stars 2.28k forks source link

Gradio for .NET developers #8380

Closed feiyun0112 closed 1 month ago

feiyun0112 commented 1 month ago

Hi, Gradio community

Thank you very much for creating such a great project that allows us to create web applications without any JavaScript, CSS, or web hosting experience.

However, Gradio can only be developed using Python.

I've now created a .NET port of Gradio, so .NET developers can experience the power of Gradio!

App.Launch(await CreateBlocks());

async Task<Blocks> CreateBlocks()
{
    using (var blocks = gr.Blocks())
    {
        gr.Markdown("Start typing below and then click **Run** to see the output.");
        Textbox input, output;
        using (gr.Row())
        {
            input = gr.Textbox(placeholder: "What is your name?");
            output = gr.Textbox();
        }
        var btn = gr.Button("Run");
        await btn.Click(fn: async (input) => gr.Output($"Welcome to Gradio.Net, {input.Data[0]}!"), inputs: new[] { input }, outputs: new[] { output });

        return blocks;
    }
}

https://github.com/feiyun0112/Gradio.Net/raw/main/readme_files/demo.gif

All the code has been open sourced and put in https://github.com/feiyun0112/Gradio.Net, and packaged and released to NuGet.org.

If the above practices infringe on any rights and interests of Gradio community, please contact me to correct them.

Thanks!

abidlabs commented 1 month ago

Hi @feiyun0112 this is very cool! We've communicated about this on our own social media account to bring visibility to the project: https://x.com/Gradio/status/1794773536214823153

I'd recommend building a few example demos and sharing the code + demo on social media to show how simple it is to use Gradio.NET. You might even see if its possible to host some Gradio.NET demos on Hugging Face Spaces with a custom dockerfile: https://huggingface.co/spaces