A set of extension component, inluding components for conversational input and display in multimodal scenarios, as well as more components for vertical scenarios.
Project description
ModelScope Studio
✖️
GitHub | 🤖 ModelScope Studio | 🤗 Hugging Face Space
中文 | English | 日本語
modelscope_studio
is a set of extension component libraries based on gradio 4.x, dedicated to serving the various extension needs of gradio applications within the ModelScope Studio. It mainly focuses on enhancing conversational scenarios, supporting multimodal contexts, and providing assistance for various other specialized scenarios.
Install
pip install modelscope_studio
Quickstart
import time
import gradio as gr
import modelscope_studio as mgr
def submit(_input, _chatbot):
print('text:', _input.text)
print('files: ', _input.files)
_chatbot.append([_input, None])
yield _chatbot
time.sleep(1)
_chatbot[-1][1] = [{
"flushing": False,
"text": 'bot1: ' + _input.text + '!'
}, {
"text": 'bot2: ' + _input.text + '!'
}]
yield {
chatbot: _chatbot,
}
with gr.Blocks() as demo:
chatbot = mgr.Chatbot(height=400)
input = mgr.MultimodalInput()
input.submit(fn=submit, inputs=[input, chatbot], outputs=[chatbot])
demo.queue().launch()
Component Docs
The currently supported components include:
- Chatbot: Gradio Chatbot extension component, supports multi-modal content output, multi-bot scenarios, and custom rendering components and event interactions within the conversation content.
- MultimodalInput: A multi-modal input box, supporting functions such as file upload, recording, and photography.
- Markdown: Gradio Markdown extension component, supports the output of multi-modal content (audio, video, voice, files, text).
- Lifecycle: A Lifecycle component for getting the current user's environment information.
- WaterfallGallery: Gradio Gallery extension component, supports waterfall-style image display.
- Flow: A Flow component implemented based on reactflow, supports customization of node rendering through a schema.
- More components...
For detailed usage, see Documentation and Examples
Development
Clone this repo locally:
git clone git@github.com:modelscope/modelscope-studio.git
cd modelscope-studio
# for backend
pip install -e '.'
# for frontend
npm install pnpm -g
pnpm install
pnpm build
Run demo!
gradio docs/app.py
or run a single demo like this:
gradio docs/components/Chatbot/demos/basic.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file modelscope_studio-1.0.0b2.tar.gz
.
File metadata
- Download URL: modelscope_studio-1.0.0b2.tar.gz
- Upload date:
- Size: 10.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebf517d304420f25f7afdab5a13679f30a998853b2a2b7732adf208b19af85cc |
|
MD5 | 048cb1fdda67cd4b9b59a388fa98dad1 |
|
BLAKE2b-256 | 447d569b640d6e13203b54a545c00b6bdfc4463f88cc7dbeb2fd06506cbb5e05 |
File details
Details for the file modelscope_studio-1.0.0b2-py3-none-any.whl
.
File metadata
- Download URL: modelscope_studio-1.0.0b2-py3-none-any.whl
- Upload date:
- Size: 11.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 952a7e80aa10538cd4ea93fb1102dc79341934a836a77c7644b2ab0e9bc880da |
|
MD5 | 6ae8c17b5ac7d4af1d82e1148f5ecd1a |
|
BLAKE2b-256 | 5c99013a57fa8ae9ffa28e447de4c4f22ae1910c0f64161ddb12d1f51829ccc9 |