rotative
huggingface blog · 2026年4月1日

Hugging Face 發布 gradio.Server 以支援自訂前端

hugging face 發布了 gradio.server,允許開發者在 gradio 後端基礎設施上使用 react 或原生 js 等自訂前端。該解決方案擴展了 fastapi,提供自動佇列管理、並發控制以及 spaces 上的 zerogpu 支援。僅需約 50 行 python 即可實現後端管理,前端透過 gradio js client 處理請求排隊。

read in English · 简体中文 · 日本語 · 한국어

Hugging Face 推出了 gradio.Server,一個將 Gradio 的後端基礎設施與其標準 UI 組件分離的工具。基於 FastAPI 建構,gradio.Server 允許開發人員使用 `@app.api()` 定義繼承 Gradio 佇列引擎和並發管理的自定義 API 路由。此架構支援複雜的前端 — 例如公告中展示的 1,300 行 vanilla JS 應用程式 — 同時利用後端功能,如 ZeroGPU 分配和 `gradio_client` 相容性。

read at source ↗

← rotative