The current document version is
1.0 beta
. If you are using a previous version ofmodelscope_studio
, please switch to the legacy branch for reference.
GitHub | 🤖 ModelScope Studio | 🤗 Hugging Face Space
中文 | English | 日本語
modelscope_studio
is a third-party component library based on Gradio, extending more components and usage forms on top of the original Gradio components.
Currently supported UI libraries:
Compared to Gradio's own components, modelscope_studio
focuses more on page layout and component flexibility. If you want to build a more beautiful user interface, we highly recommend using modelscope_studio
.
However, when your application needs Gradio to handle more built-in data on the Python side, modelscope_studio
may not be the best choice, but you can still use modelscope_studio
's layout and display components to help build your app.
- Gradio >= 4.0
Currently,
modelscope_studio
version 1.0 is still under development. You can use thebeta
version in advance.
pip install modelscope_studio~=1.0.0b
import gradio as gr
import modelscope_studio.components.antd as antd
import modelscope_studio.components.base as ms
with gr.Blocks() as demo:
with ms.Application():
with antd.ConfigProvider():
antd.DatePicker()
demo.queue().launch()
If you have previously used modelscope_studio
components and want to continue using them in the new version, no modifications to the original components are needed. You just need to introduce ms.Application
in the outer layer.
import gradio as gr
import modelscope_studio.components.base as ms
import modelscope_studio.components.legacy as mgr
with gr.Blocks() as demo:
with ms.Application():
mgr.Chatbot()
demo.launch()
Clone this repo locally:
git clone [email protected]:modelscope/modelscope-studio.git
cd modelscope-studio
# for backend
pip install -e '.'
# for frontend
npm install pnpm -g
pnpm install
pnpm build
Run gradio cc dev
to start demo:
gradio cc dev docs/app.py