modelscope-studio


Namemodelscope-studio JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA set of extension component, inluding components for conversational input and display in multimodal scenarios, as well as more components for vertical scenarios.
upload_time2024-04-19 03:38:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords gradio-custom-component gradio-template-chatbot modelscope-studio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1>ModelScope Studio</h1>

<p align="center">
    <img src="https://modelscope.oss-cn-beijing.aliyuncs.com/modelscope.gif" height="60" style="vertical-align: middle;"/>
    <span style="font-size: 30px; vertical-align: middle;">
    ✖️
    </span>
    <img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
<p>

<p align="center">
<a href="https://github.com/modelscope/modelscope-studio">GitHub</a> | 🤖 <a href="https://modelscope.cn/studios/modelscope/modelscope-studio/summary">ModelScope Studio</a> | 🤗 <a href="https://huggingface.co/spaces/modelscope/modelscope-studio">Hugging Face Space</a>
<br>
  <a href="README-zh_CN.md">中文</a>&nbsp | &nbspEnglish&nbsp | &nbsp<a href="README-ja_JP.md">日本語</a>
</p>

`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

```sh
pip install modelscope_studio
```

## Quickstart

```python
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](./resources/quickstart.png)

## 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).
- WaterfallGallery: gradio Gallery extension component, supports waterfall-style image display.
- More components...

For detailed usage, see [Documentation and Examples](https://modelscope.cn/studios/modelscope/modelscope-studio/summary)

## Development

Clone this repo locally:

```sh
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!

```sh
gradio docs/app.py
```

or run a single demo like this:

```sh
gradio docs/components/Chatbot/demos/basic.py
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "modelscope-studio",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "gradio-custom-component, gradio-template-Chatbot, modelscope-studio",
    "author": null,
    "author_email": "YOUR NAME <YOUREMAIL@domain.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/6a/a16793e05bd8f398db371414f86f57bdbff9a6e47dbb93bb43fc83f55a2f/modelscope_studio-0.2.0.tar.gz",
    "platform": null,
    "description": "<h1>ModelScope Studio</h1>\n\n<p align=\"center\">\n    <img src=\"https://modelscope.oss-cn-beijing.aliyuncs.com/modelscope.gif\" height=\"60\" style=\"vertical-align: middle;\"/>\n    <span style=\"font-size: 30px; vertical-align: middle;\">\n    \u2716\ufe0f\n    </span>\n    <img src=\"https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg\" height=\"60\" style=\"vertical-align: middle;\">\n<p>\n\n<p align=\"center\">\n<a href=\"https://github.com/modelscope/modelscope-studio\">GitHub</a> | \ud83e\udd16 <a href=\"https://modelscope.cn/studios/modelscope/modelscope-studio/summary\">ModelScope Studio</a> \uff5c \ud83e\udd17 <a href=\"https://huggingface.co/spaces/modelscope/modelscope-studio\">Hugging Face Space</a>\n<br>\n  <a href=\"README-zh_CN.md\">\u4e2d\u6587</a>&nbsp \uff5c &nbspEnglish&nbsp \uff5c &nbsp<a href=\"README-ja_JP.md\">\u65e5\u672c\u8a9e</a>\n</p>\n\n`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.\n\n## Install\n\n```sh\npip install modelscope_studio\n```\n\n## Quickstart\n\n```python\nimport time\nimport gradio as gr\nimport modelscope_studio as mgr\n\ndef submit(_input, _chatbot):\n    print('text\uff1a', _input.text)\n    print('files: ', _input.files)\n    _chatbot.append([_input, None])\n    yield _chatbot\n    time.sleep(1)\n    _chatbot[-1][1] = [{\n        \"flushing\": False,\n        \"text\": 'bot1: ' + _input.text + '!'\n    }, {\n        \"text\": 'bot2: ' + _input.text + '!'\n    }]\n    yield {\n        chatbot: _chatbot,\n    }\n\nwith gr.Blocks() as demo:\n    chatbot = mgr.Chatbot(height=400)\n\n    input = mgr.MultimodalInput()\n    input.submit(fn=submit, inputs=[input, chatbot], outputs=[chatbot])\n\ndemo.queue().launch()\n```\n\n![quickstart](./resources/quickstart.png)\n\n## Component Docs\n\nThe currently supported components include:\n\n- Chatbot: gradio Chatbot extension component, supports multi-modal content output, multi-bot scenarios, and custom rendering components and event interactions within the conversation content.\n- MultimodalInput: A multi-modal input box, supporting functions such as file upload, recording, and photography.\n- Markdown: gradio Markdown extension component, supports the output of multi-modal content (audio, video, voice, files, text).\n- WaterfallGallery: gradio Gallery extension component, supports waterfall-style image display.\n- More components...\n\nFor detailed usage, see [Documentation and Examples](https://modelscope.cn/studios/modelscope/modelscope-studio/summary)\n\n## Development\n\nClone this repo locally:\n\n```sh\ngit clone git@github.com:modelscope/modelscope-studio.git\ncd modelscope-studio\n# for backend\npip install -e '.'\n# for frontend\nnpm install pnpm -g\n\npnpm install\npnpm build\n```\n\nRun demo!\n\n```sh\ngradio docs/app.py\n```\n\nor run a single demo like this:\n\n```sh\ngradio docs/components/Chatbot/demos/basic.py\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A set of extension component, inluding components for conversational input and display in multimodal scenarios, as well as more components for vertical scenarios.",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [
        "gradio-custom-component",
        " gradio-template-chatbot",
        " modelscope-studio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cd21571d0b12ef88f86e92142b3615af49245223a8bef041b4980e837922247",
                "md5": "3221393f361b17717741c2371291f1c0",
                "sha256": "26497677e515ca086a7da0719cd3268516f842bab0833ebb00cd33a558b6a1bb"
            },
            "downloads": -1,
            "filename": "modelscope_studio-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3221393f361b17717741c2371291f1c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11001355,
            "upload_time": "2024-04-19T03:38:03",
            "upload_time_iso_8601": "2024-04-19T03:38:03.579132Z",
            "url": "https://files.pythonhosted.org/packages/0c/d2/1571d0b12ef88f86e92142b3615af49245223a8bef041b4980e837922247/modelscope_studio-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a66aa16793e05bd8f398db371414f86f57bdbff9a6e47dbb93bb43fc83f55a2f",
                "md5": "e9f8d67897851c82aa689cbe37d64abd",
                "sha256": "c7ad5df18aee220cbb03de800bb93e6115229719246556401f78f7e104259ec1"
            },
            "downloads": -1,
            "filename": "modelscope_studio-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e9f8d67897851c82aa689cbe37d64abd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10886731,
            "upload_time": "2024-04-19T03:38:10",
            "upload_time_iso_8601": "2024-04-19T03:38:10.609655Z",
            "url": "https://files.pythonhosted.org/packages/a6/6a/a16793e05bd8f398db371414f86f57bdbff9a6e47dbb93bb43fc83f55a2f/modelscope_studio-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 03:38:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "modelscope-studio"
}
        
Elapsed time: 0.23341s