Chinafeiyun0112/Gradio.Net
⭐Gradio for .NET – a port of Gradio, an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function. Gradio for .NET – 基于 Gradio 的 .NET 移植,Gradio 是一个开源 Python 包,允许你为机器学习模型、API 或任何任意 Python 函数快速构建演示或 Web 应用程序。
⚡ Gradio for .NET — turn any C# method into a web app
Same frontend, same protocol, same config as Python Gradio — but the handler is C#.
Gradio.Net is a .NET port of Gradio 6.30.0, the Python package that turns a function into a web demo. It lets you build a UI for a model, an API or any C# method in a few lines: users drag in images, paste text, record voice, and talk to your code through the browser. No JavaScript, no CSS.
✨ Highlights
- Drop-in port: page rendered by the Python version's own compiled frontend, unchanged; same protocol and config.
- gr.Interface: wraps any C# method into a page, built from the handler's signature, no layout code.
- gr.Blocks: full layout control —
Row,Column,Tabs/Tab, events likebutton.Click(fn, inputs, outputs). - ASP.NET Core native:
AddGradio()plusUseGradio(page)serves routes, assets and queue inside your host. - One API, two spellings:
grfactories match Python names and defaults; underneath sit ordinary typed components you can hold, pass or subclass. - Streaming support: generator handlers
yieldpieces that replace the output live, withProgressmoving the bar. - Chat and forms:
gr.ChatInterfacestreams answers from an endpoint; forms submit many fields at once and link fields viagr.Update.
💡 Why it matters
For .NET teams this removes the usual tax of shipping a model demo: no Python sidecar, no hand-written frontend. A ported Python file differs by three edits only — = becomes :, with becomes using, a decorator becomes a call — and GrPortingTests checks that parity.
It fits model demos, API playgrounds and internal tools where the logic already lives in C#. The README ships runnable demos (Quickstart, Blocks, Chat, Streaming, Form) to copy from.
#Gradio #DotNet #MachineLearning #TiniX
Similar Projects
Discover other similar projects and AI models.
Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
Streamlit — The agent-native framework for data apps and dashboards.
Learn how to develop, deploy and iterate on production-grade ML applications.
10 Weeks, 20 Lessons, Data Science for All!
Roadmap to becoming an Artificial Intelligence Expert in 2022