Socket
Socket
Sign inDemoInstall

modelscope-studio

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modelscope-studio

A set of extension component, inluding components for conversational input and display in multimodal scenarios, as well as more components for vertical scenarios.


Maintainers
1

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()

quickstart

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc