-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
375 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@modelscope-studio/legacy-waterfall-gallery': patch | ||
'@modelscope-studio/legacy-multimodal-input': patch | ||
'@modelscope-studio/legacy-lifecycle': patch | ||
'@modelscope-studio/legacy-markdown': patch | ||
'@modelscope-studio/legacy-compiled': patch | ||
'@modelscope-studio/legacy-chatbot': patch | ||
'@modelscope-studio/legacy-flow': patch | ||
'@modelscope-studio/lint-config': patch | ||
'@modelscope-studio/changelog': patch | ||
'@modelscope-studio/antd': patch | ||
'@modelscope-studio/base': patch | ||
'@modelscope-studio/frontend': patch | ||
'modelscope_studio': patch | ||
--- | ||
|
||
fix: component paramters in Python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Input | ||
|
||
Through mouse or keyboard input content, it is the most basic form field wrapper. See [Ant Design](https://ant.design/components/input/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Input | ||
|
||
Through mouse or keyboard input content, it is the most basic form field wrapper. See [Ant Design](https://ant.design/components/input/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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(): | ||
with antd.Space(direction="vertical"): | ||
antd.Input() | ||
antd.Input.Password() | ||
antd.Input.Textarea( | ||
placeholder= | ||
"Autosize height with minimum and maximum number of lines", | ||
auto_size={ | ||
"minRows": 2, | ||
"maxRows": 6 | ||
}) | ||
antd.Input.Search(placeholder="Input search text", | ||
addon_before="https://", | ||
allow_clear=True) | ||
with antd.Input.Search(enter_button="Search", | ||
placeholder="input search text", | ||
size="large"): | ||
with ms.Slot("suffix"): | ||
antd.Icon("AudioOutlined", | ||
elem_style=dict(fontSize=16, | ||
color="#1677ff")) | ||
antd.Input.OTP() | ||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# InputNumber | ||
|
||
Enter a number within certain range with the mouse or keyboard. See [Ant Design](https://ant.design/components/input-number/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# InputNumber | ||
|
||
Enter a number within certain range with the mouse or keyboard. See [Ant Design](https://ant.design/components/input-number/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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(): | ||
with antd.Space(direction="vertical"): | ||
antd.InputNumber() | ||
antd.InputNumber(min=1, max=10, keyboard=True) | ||
antd.InputNumber(value=100, addon_after="$", addon_before="+") | ||
with antd.InputNumber(value=100): | ||
with ms.Slot("addonBefore"): | ||
antd.Select(value="add", | ||
elem_style=dict(width=60), | ||
options=[{ | ||
"value": "add", | ||
"label": "+" | ||
}, { | ||
"value": "minus", | ||
"label": "-" | ||
}]) | ||
with ms.Slot("addonAfter"): | ||
antd.Select(value="USD", | ||
elem_style=dict(width=60), | ||
options=[{ | ||
"value": "USD", | ||
"label": "$" | ||
}, { | ||
"value": "EUR", | ||
"label": "€" | ||
}, { | ||
"value": "GBP", | ||
"label": "£" | ||
}, { | ||
"value": "CNY", | ||
"label": "¥" | ||
}]) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Mentions | ||
|
||
Used to mention someone or something in an input. See [Ant Design](https://ant.design/components/mentions/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="dynamic_options" title="Dynamic Options"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Mentions | ||
|
||
Used to mention someone or something in an input. See [Ant Design](https://ant.design/components/mentions/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="dynamic_options" title="Dynamic Options"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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(): | ||
with antd.Space(direction="vertical"): | ||
antd.Mentions(elem_style=dict(width=320), | ||
placeholder="Input @ to mention", | ||
options=[{ | ||
"value": "modelscope", | ||
"label": "modelscope" | ||
}, { | ||
"value": "gradio", | ||
"label": "gradio" | ||
}, { | ||
"value": "ant design", | ||
"label": "ant design" | ||
}]) | ||
with antd.Mentions(elem_style=dict(width=320), | ||
prefix=['@', "#"], | ||
placeholder="Input @ or # to mention"): | ||
with antd.Mentions.Option(value="modelscope"): | ||
with ms.Slot("label"): | ||
antd.Typography.Text("modelscope", type="success") | ||
with antd.Mentions.Option(value="gradio"): | ||
with ms.Slot("label"): | ||
antd.Typography.Text("gradio", type="success") | ||
with antd.Mentions.Option(value="ant design"): | ||
with ms.Slot("label"): | ||
antd.Typography.Text("ant design", type="success") | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
|
||
def on_search(e: gr.EventData): | ||
prefix = e._data['payload'][1] | ||
if prefix == '@': | ||
return gr.update(options=[{ | ||
"value": "modelscope", | ||
"label": "modelscope" | ||
}, { | ||
"value": "gradio", | ||
"label": "gradio" | ||
}, { | ||
"value": "ant design", | ||
"label": "ant design" | ||
}]) | ||
elif prefix == '#': | ||
return gr.update(options=[{ | ||
"value": "1.0", | ||
"label": "1.0" | ||
}, { | ||
"value": "2.0", | ||
"label": "2.0" | ||
}, { | ||
"value": "3.0", | ||
"label": "3.0" | ||
}]) | ||
|
||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
mentions = antd.Mentions( | ||
elem_style=dict(width='100%'), | ||
prefix=['@', "#"], | ||
placeholder="input @ to mention people, # to mention tag") | ||
mentions.search(fn=on_search, outputs=[mentions]) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Radio | ||
|
||
Used to select a single state from multiple options. See [Ant Design](https://ant.design/components/radio/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Radio | ||
|
||
Used to select a single state from multiple options. See [Ant Design](https://ant.design/components/radio/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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(): | ||
with antd.Radio(): | ||
ms.Text("Radio") | ||
antd.Divider("Radio Group") | ||
with antd.Radio.Group(): | ||
with antd.Radio(group_value=1): | ||
ms.Text("A") | ||
with antd.Radio(group_value=2): | ||
ms.Text("B") | ||
with antd.Radio(group_value=3): | ||
ms.Text("C") | ||
with antd.Radio(group_value=4): | ||
ms.Text("D") | ||
antd.Divider("Configuring Options") | ||
antd.Radio.Group(option_type="button", | ||
button_style="solid", | ||
options=[ | ||
{ | ||
"label": 'Apple', | ||
"value": 'Apple' | ||
}, | ||
{ | ||
"label": 'Pear', | ||
"value": 'Pear' | ||
}, | ||
{ | ||
"label": 'Orange', | ||
"value": 'Orange', | ||
"disabled": True | ||
}, | ||
]) | ||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Rate | ||
|
||
Used for rating operation on something. See [Ant Design](https://ant.design/components/rate/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
Oops, something went wrong.