modelscope-studio 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modelscope_studio-0.0.3/PKG-INFO +124 -0
- modelscope_studio-0.0.3/README.md +97 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/templates/component/index.js +385 -386
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/pyproject.toml +1 -4
- modelscope_studio-0.0.2/PKG-INFO +0 -1285
- modelscope_studio-0.0.2/README.md +0 -1258
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/.gitignore +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/LICENSE +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/__init__.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/__init__.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/__init__.pyi +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/llm_thinking_presets.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/templates/component/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/templates/example/index.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Chatbot/templates/example/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/__init__.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/__init__.pyi +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/templates/component/index.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/templates/component/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/templates/example/index.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/Markdown/templates/example/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/__init__.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/__init__.pyi +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/component/__vite-browser-external-2447137e.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/component/index.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/component/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/component/wrapper-6f348d45-f837cf34.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/example/index.js +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/components/MultimodalInput/templates/example/style.css +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/utils/__init__.py +0 -0
- {modelscope_studio-0.0.2 → modelscope_studio-0.0.3}/backend/modelscope_studio/utils/process_links.py +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: modelscope_studio
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: A set of extension component, inluding components for conversational input and display in multimodal scenarios, as well as more components for vertical scenarios.
|
|
5
|
+
Author-email: YOUR NAME <YOUREMAIL@domain.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: gradio-custom-component,gradio-template-Chatbot,modelscope-studio
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Requires-Dist: gradio<5.0,>=4.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: build; extra == 'dev'
|
|
25
|
+
Requires-Dist: twine; extra == 'dev'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
<h1>Modelscope Studio</h1>
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="https://modelscope.oss-cn-beijing.aliyuncs.com/modelscope.gif" height="60" style="vertical-align: middle;"/>
|
|
32
|
+
<span style="font-size: 30px; vertical-align: middle;">
|
|
33
|
+
✖️
|
|
34
|
+
</span>
|
|
35
|
+
<img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
|
|
36
|
+
<p>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<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">HuggingFace Space</a>
|
|
40
|
+
<br>
|
|
41
|
+
<a href="README-zh_CN.md">中文</a>  |  English
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
`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.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
pip install modelscope_studio
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Quickstart
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import time
|
|
56
|
+
import gradio as gr
|
|
57
|
+
import modelscope_studio as mgr
|
|
58
|
+
|
|
59
|
+
def submit(_input, _chatbot):
|
|
60
|
+
print('text:', _input.text)
|
|
61
|
+
print('files: ', _input.files)
|
|
62
|
+
_chatbot.append([_input, None])
|
|
63
|
+
yield _chatbot
|
|
64
|
+
time.sleep(1)
|
|
65
|
+
_chatbot[-1][1] = [{
|
|
66
|
+
"flushing": False,
|
|
67
|
+
"text": 'bot1: ' + _input.text + '!'
|
|
68
|
+
}, {
|
|
69
|
+
"text": 'bot2: ' + _input.text + '!'
|
|
70
|
+
}]
|
|
71
|
+
yield {
|
|
72
|
+
chatbot: _chatbot,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
with gr.Blocks() as demo:
|
|
76
|
+
chatbot = mgr.Chatbot(height=400)
|
|
77
|
+
|
|
78
|
+
input = mgr.MultimodalInput()
|
|
79
|
+
input.submit(fn=submit, inputs=[input, chatbot], outputs=[chatbot])
|
|
80
|
+
|
|
81
|
+
demo.queue().launch()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
## Component Docs
|
|
87
|
+
|
|
88
|
+
The currently supported components include:
|
|
89
|
+
|
|
90
|
+
- Chatbot: gradio Chatbot extension component, supports multi-modal content output, multi-bot scenarios, and custom rendering components and event interactions within the conversation content.
|
|
91
|
+
- MultimodalInput: A multi-modal input box, supporting functions such as file upload, recording, and photography.
|
|
92
|
+
- Markdown: gradio Markdown extension component, supports the output of multi-modal content (audio, video, voice, files, text).
|
|
93
|
+
- ImageGallery (WIP): gradio Gallery extension component, supports waterfall-style image display.
|
|
94
|
+
- More components...
|
|
95
|
+
|
|
96
|
+
For detailed usage, see [Documentation and Examples](https://modelscope.cn/studios/modelscope/modelscope-studio/summary)
|
|
97
|
+
|
|
98
|
+
## Development
|
|
99
|
+
|
|
100
|
+
Clone this repo locally:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
git clone git@github.com:modelscope/modelscope-studio.git
|
|
104
|
+
cd modelscope-studio
|
|
105
|
+
# for backend
|
|
106
|
+
pip install -e '.'
|
|
107
|
+
# for frontend
|
|
108
|
+
npm install pnpm -g
|
|
109
|
+
|
|
110
|
+
pnpm install
|
|
111
|
+
pnpm build
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Run demo!
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
gradio docs/app.py
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
or run a single demo like this:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
gradio docs/components/Chatbot/demos/basic.py
|
|
124
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<h1>Modelscope Studio</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://modelscope.oss-cn-beijing.aliyuncs.com/modelscope.gif" height="60" style="vertical-align: middle;"/>
|
|
5
|
+
<span style="font-size: 30px; vertical-align: middle;">
|
|
6
|
+
✖️
|
|
7
|
+
</span>
|
|
8
|
+
<img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
|
|
9
|
+
<p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<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">HuggingFace Space</a>
|
|
13
|
+
<br>
|
|
14
|
+
<a href="README-zh_CN.md">中文</a>  |  English
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
`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.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
pip install modelscope_studio
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quickstart
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import time
|
|
29
|
+
import gradio as gr
|
|
30
|
+
import modelscope_studio as mgr
|
|
31
|
+
|
|
32
|
+
def submit(_input, _chatbot):
|
|
33
|
+
print('text:', _input.text)
|
|
34
|
+
print('files: ', _input.files)
|
|
35
|
+
_chatbot.append([_input, None])
|
|
36
|
+
yield _chatbot
|
|
37
|
+
time.sleep(1)
|
|
38
|
+
_chatbot[-1][1] = [{
|
|
39
|
+
"flushing": False,
|
|
40
|
+
"text": 'bot1: ' + _input.text + '!'
|
|
41
|
+
}, {
|
|
42
|
+
"text": 'bot2: ' + _input.text + '!'
|
|
43
|
+
}]
|
|
44
|
+
yield {
|
|
45
|
+
chatbot: _chatbot,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
with gr.Blocks() as demo:
|
|
49
|
+
chatbot = mgr.Chatbot(height=400)
|
|
50
|
+
|
|
51
|
+
input = mgr.MultimodalInput()
|
|
52
|
+
input.submit(fn=submit, inputs=[input, chatbot], outputs=[chatbot])
|
|
53
|
+
|
|
54
|
+
demo.queue().launch()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
## Component Docs
|
|
60
|
+
|
|
61
|
+
The currently supported components include:
|
|
62
|
+
|
|
63
|
+
- Chatbot: gradio Chatbot extension component, supports multi-modal content output, multi-bot scenarios, and custom rendering components and event interactions within the conversation content.
|
|
64
|
+
- MultimodalInput: A multi-modal input box, supporting functions such as file upload, recording, and photography.
|
|
65
|
+
- Markdown: gradio Markdown extension component, supports the output of multi-modal content (audio, video, voice, files, text).
|
|
66
|
+
- ImageGallery (WIP): gradio Gallery extension component, supports waterfall-style image display.
|
|
67
|
+
- More components...
|
|
68
|
+
|
|
69
|
+
For detailed usage, see [Documentation and Examples](https://modelscope.cn/studios/modelscope/modelscope-studio/summary)
|
|
70
|
+
|
|
71
|
+
## Development
|
|
72
|
+
|
|
73
|
+
Clone this repo locally:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
git clone git@github.com:modelscope/modelscope-studio.git
|
|
77
|
+
cd modelscope-studio
|
|
78
|
+
# for backend
|
|
79
|
+
pip install -e '.'
|
|
80
|
+
# for frontend
|
|
81
|
+
npm install pnpm -g
|
|
82
|
+
|
|
83
|
+
pnpm install
|
|
84
|
+
pnpm build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Run demo!
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
gradio docs/app.py
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
or run a single demo like this:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
gradio docs/components/Chatbot/demos/basic.py
|
|
97
|
+
```
|