modelscope-studio 0.1.6__tar.gz → 0.1.7__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.1.6 → modelscope_studio-0.1.7}/PKG-INFO +1 -1
- modelscope_studio-0.1.7/backend/modelscope_studio/components/Flow/__init__.pyi +257 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/component/index.js +1372 -1371
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/pyproject.toml +9 -1
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/.gitignore +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/LICENSE +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/README.md +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/__init__.pyi +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/llm_thinking_presets.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/templates/component/index-9933f53a.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/templates/component/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/templates/component/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/templates/example/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Chatbot/templates/example/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/__init__.pyi +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/component/index-9933f53a.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/component/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/component/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/example/index-9933f53a.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/example/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/Markdown/templates/example/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/__init__.pyi +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/component/__vite-browser-external-2447137e.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/component/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/component/wrapper-6f348d45-f837cf34.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/example/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/MultimodalInput/templates/example/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/WaterfallGallery/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/WaterfallGallery/__init__.pyi +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/WaterfallGallery/templates/component/index.js +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/components/WaterfallGallery/templates/component/style.css +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/utils/__init__.py +0 -0
- {modelscope_studio-0.1.6 → modelscope_studio-0.1.7}/backend/modelscope_studio/utils/process_links.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: modelscope_studio
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
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
5
|
Author-email: YOUR NAME <YOUREMAIL@domain.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple, TypedDict, Union
|
|
4
|
+
|
|
5
|
+
from gradio import processing_utils
|
|
6
|
+
from gradio.components.base import Component
|
|
7
|
+
from gradio.data_classes import GradioModel
|
|
8
|
+
from gradio.events import Events
|
|
9
|
+
from gradio_client.documentation import document
|
|
10
|
+
|
|
11
|
+
from modelscope_studio.utils import CustomComponentDict, resolve_frontend_dir
|
|
12
|
+
|
|
13
|
+
from .edge import *
|
|
14
|
+
from .node import *
|
|
15
|
+
from .node_schema import *
|
|
16
|
+
|
|
17
|
+
class FlowData(GradioModel):
|
|
18
|
+
nodes: Optional[List[Union[Node, dict]]] = []
|
|
19
|
+
edges: Optional[List[Union[Edge, dict]]] = []
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class FlowSchemaDict(TypedDict):
|
|
23
|
+
nodes: Optional[List[Union[NodeSchemaDict, dict]]] = []
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BackgroundPropsDict(TypedDict):
|
|
27
|
+
color: Optional[str]
|
|
28
|
+
className: Optional[str]
|
|
29
|
+
# The gap between patterns. Passing in a tuple allows you to control the x and y gap independently.
|
|
30
|
+
gap: Optional[Union[int, Tuple[int, int]]]
|
|
31
|
+
# The radius of each dot or the size of each rectangle if BackgroundVariant.Dots or BackgroundVariant.Cross is used. This defaults to 1 or 6 respectively, or ignored if BackgroundVariant.Lines is used.
|
|
32
|
+
size: Optional[int]
|
|
33
|
+
offset: Optional[int]
|
|
34
|
+
lineWidth: Optional[int]
|
|
35
|
+
variant: Optional[Literal['dots', 'lines', 'cross']]
|
|
36
|
+
|
|
37
|
+
from gradio.events import Dependency
|
|
38
|
+
|
|
39
|
+
@document()
|
|
40
|
+
class ModelScopeFlow(Component):
|
|
41
|
+
data_model = FlowData
|
|
42
|
+
FRONTEND_DIR = resolve_frontend_dir("Flow")
|
|
43
|
+
EVENTS = [Events.change, 'data_change', 'custom']
|
|
44
|
+
|
|
45
|
+
def __init__(self,
|
|
46
|
+
value: dict | FlowData | Callable | None = None,
|
|
47
|
+
*,
|
|
48
|
+
label: str | None = None,
|
|
49
|
+
info: str | None = None,
|
|
50
|
+
every: float | None = None,
|
|
51
|
+
show_label: bool | None = None,
|
|
52
|
+
container: bool = True,
|
|
53
|
+
scale: int | None = None,
|
|
54
|
+
min_width: int = 160,
|
|
55
|
+
interactive: bool | None = None,
|
|
56
|
+
visible: bool = True,
|
|
57
|
+
elem_id: str | None = None,
|
|
58
|
+
elem_classes: List[str] | str | None = None,
|
|
59
|
+
render: bool = True,
|
|
60
|
+
height: int | str | None = 600,
|
|
61
|
+
schema: Union[FlowSchemaDict, dict] | None = None,
|
|
62
|
+
show_sidebar: bool | None = None,
|
|
63
|
+
show_minimap: bool | None = None,
|
|
64
|
+
show_controls: bool | None = None,
|
|
65
|
+
background_props: dict | None = None,
|
|
66
|
+
min_zoom: float | int | None = 0.1,
|
|
67
|
+
max_zoom: float | int | None = 2,
|
|
68
|
+
custom_components: Dict[str, CustomComponentDict]
|
|
69
|
+
| None = None):
|
|
70
|
+
"""
|
|
71
|
+
Parameters:
|
|
72
|
+
value: FlowData or dict
|
|
73
|
+
height: The height of the flow component, specified in pixels if a number is passed, or in CSS units if a string is passed.
|
|
74
|
+
schema: Define the nodes and edges for the flow.
|
|
75
|
+
custom_components: Define the custom node types for the flow schema.
|
|
76
|
+
"""
|
|
77
|
+
self.height = height
|
|
78
|
+
self.custom_components = custom_components
|
|
79
|
+
self.show_sidebar = show_sidebar
|
|
80
|
+
self.show_minimap = show_minimap
|
|
81
|
+
self.show_controls = show_controls
|
|
82
|
+
self.background_props = background_props
|
|
83
|
+
self.min_zoom = min_zoom
|
|
84
|
+
self.max_zoom = max_zoom
|
|
85
|
+
|
|
86
|
+
super().__init__(
|
|
87
|
+
label=label,
|
|
88
|
+
info=info,
|
|
89
|
+
every=every,
|
|
90
|
+
show_label=show_label,
|
|
91
|
+
container=container,
|
|
92
|
+
scale=scale,
|
|
93
|
+
min_width=min_width,
|
|
94
|
+
interactive=interactive,
|
|
95
|
+
visible=visible,
|
|
96
|
+
elem_id=elem_id,
|
|
97
|
+
elem_classes=elem_classes,
|
|
98
|
+
render=render,
|
|
99
|
+
value=value,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
self.schema = self._process_schema(schema)
|
|
103
|
+
|
|
104
|
+
def _process_schema(self, schema: Union[FlowSchemaDict, dict] | None):
|
|
105
|
+
if schema is not None:
|
|
106
|
+
nodes = schema.get('nodes', [])
|
|
107
|
+
for node in nodes:
|
|
108
|
+
icon_url = node.get('icon')
|
|
109
|
+
if isinstance(icon_url, str):
|
|
110
|
+
node[
|
|
111
|
+
"icon"] = processing_utils.move_resource_to_block_cache(
|
|
112
|
+
icon_url, self)
|
|
113
|
+
return schema
|
|
114
|
+
|
|
115
|
+
def preprocess(self, payload: FlowData | dict | None) -> dict | None:
|
|
116
|
+
if payload is None:
|
|
117
|
+
return FlowData()
|
|
118
|
+
if isinstance(payload, dict):
|
|
119
|
+
return FlowData(**payload)
|
|
120
|
+
return payload
|
|
121
|
+
|
|
122
|
+
def postprocess(self, value: FlowData | dict | None) -> dict | None:
|
|
123
|
+
if value is None:
|
|
124
|
+
return FlowData()
|
|
125
|
+
if isinstance(value, dict):
|
|
126
|
+
return FlowData(**value)
|
|
127
|
+
return value
|
|
128
|
+
|
|
129
|
+
def example_inputs(self) -> Any:
|
|
130
|
+
return {"nodes": [], "edges": []}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def change(self,
|
|
134
|
+
fn: Callable | None,
|
|
135
|
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
|
136
|
+
outputs: Component | Sequence[Component] | None = None,
|
|
137
|
+
api_name: str | None | Literal[False] = None,
|
|
138
|
+
scroll_to_output: bool = False,
|
|
139
|
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
|
140
|
+
queue: bool | None = None,
|
|
141
|
+
batch: bool = False,
|
|
142
|
+
max_batch_size: int = 4,
|
|
143
|
+
preprocess: bool = True,
|
|
144
|
+
postprocess: bool = True,
|
|
145
|
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
|
146
|
+
every: float | None = None,
|
|
147
|
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
|
148
|
+
js: str | None = None,
|
|
149
|
+
concurrency_limit: int | None | Literal["default"] = "default",
|
|
150
|
+
concurrency_id: str | None = None,
|
|
151
|
+
show_api: bool = True) -> Dependency:
|
|
152
|
+
"""
|
|
153
|
+
Parameters:
|
|
154
|
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
|
155
|
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
|
156
|
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
|
157
|
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
|
158
|
+
scroll_to_output: If True, will scroll to output component on completion
|
|
159
|
+
show_progress: If True, will show progress animation while pending
|
|
160
|
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
|
161
|
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
|
162
|
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
|
163
|
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
|
164
|
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
|
165
|
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
|
166
|
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
|
167
|
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
|
168
|
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
|
169
|
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
|
170
|
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
|
171
|
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
|
172
|
+
"""
|
|
173
|
+
...
|
|
174
|
+
|
|
175
|
+
def data_change(self,
|
|
176
|
+
fn: Callable | None,
|
|
177
|
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
|
178
|
+
outputs: Component | Sequence[Component] | None = None,
|
|
179
|
+
api_name: str | None | Literal[False] = None,
|
|
180
|
+
scroll_to_output: bool = False,
|
|
181
|
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
|
182
|
+
queue: bool | None = None,
|
|
183
|
+
batch: bool = False,
|
|
184
|
+
max_batch_size: int = 4,
|
|
185
|
+
preprocess: bool = True,
|
|
186
|
+
postprocess: bool = True,
|
|
187
|
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
|
188
|
+
every: float | None = None,
|
|
189
|
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
|
190
|
+
js: str | None = None,
|
|
191
|
+
concurrency_limit: int | None | Literal["default"] = "default",
|
|
192
|
+
concurrency_id: str | None = None,
|
|
193
|
+
show_api: bool = True) -> Dependency:
|
|
194
|
+
"""
|
|
195
|
+
Parameters:
|
|
196
|
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
|
197
|
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
|
198
|
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
|
199
|
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
|
200
|
+
scroll_to_output: If True, will scroll to output component on completion
|
|
201
|
+
show_progress: If True, will show progress animation while pending
|
|
202
|
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
|
203
|
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
|
204
|
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
|
205
|
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
|
206
|
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
|
207
|
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
|
208
|
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
|
209
|
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
|
210
|
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
|
211
|
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
|
212
|
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
|
213
|
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
|
214
|
+
"""
|
|
215
|
+
...
|
|
216
|
+
|
|
217
|
+
def custom(self,
|
|
218
|
+
fn: Callable | None,
|
|
219
|
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
|
220
|
+
outputs: Component | Sequence[Component] | None = None,
|
|
221
|
+
api_name: str | None | Literal[False] = None,
|
|
222
|
+
scroll_to_output: bool = False,
|
|
223
|
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
|
224
|
+
queue: bool | None = None,
|
|
225
|
+
batch: bool = False,
|
|
226
|
+
max_batch_size: int = 4,
|
|
227
|
+
preprocess: bool = True,
|
|
228
|
+
postprocess: bool = True,
|
|
229
|
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
|
230
|
+
every: float | None = None,
|
|
231
|
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
|
232
|
+
js: str | None = None,
|
|
233
|
+
concurrency_limit: int | None | Literal["default"] = "default",
|
|
234
|
+
concurrency_id: str | None = None,
|
|
235
|
+
show_api: bool = True) -> Dependency:
|
|
236
|
+
"""
|
|
237
|
+
Parameters:
|
|
238
|
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
|
239
|
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
|
240
|
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
|
241
|
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
|
242
|
+
scroll_to_output: If True, will scroll to output component on completion
|
|
243
|
+
show_progress: If True, will show progress animation while pending
|
|
244
|
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
|
245
|
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
|
246
|
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
|
247
|
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
|
248
|
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
|
249
|
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
|
250
|
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
|
251
|
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
|
252
|
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
|
253
|
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
|
254
|
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
|
255
|
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
|
256
|
+
"""
|
|
257
|
+
...
|