Chenglu-She commited on
Commit
1fb2616
1 Parent(s): e8dac25

Upload folder using huggingface_hub

Browse files
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM python:3.9
3
+
4
+ WORKDIR /code
5
+
6
+ COPY --link --chown=1000 . .
7
+
8
+ RUN mkdir -p /tmp/cache/
9
+ RUN chmod a+rwx -R /tmp/cache/
10
+ ENV TRANSFORMERS_CACHE=/tmp/cache/
11
+
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
15
+
16
+ CMD ["python", "space.py"]
README.md CHANGED
@@ -1,10 +1,17 @@
 
1
  ---
2
- title: Gradio Log
3
- emoji: 👀
4
- colorFrom: blue
5
- colorTo: purple
6
  sdk: docker
7
  pinned: false
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
1
+
2
  ---
3
+ tags: [gradio-custom-component,gradio-template-SimpleTextbox]
4
+ title: gradio_log V0.0.1
5
+ colorFrom: indigo
6
+ colorTo: blue
7
  sdk: docker
8
  pinned: false
9
+ license: apache-2.0
10
  ---
11
 
12
+
13
+ # Name: gradio_log
14
+
15
+ Description: Python library for easily interacting with trained machine learning models
16
+
17
+ Install with: pip install gradio_log
__init__.py ADDED
File without changes
__pycache__/__init__.cpython-311.pyc ADDED
Binary file (155 Bytes). View file
 
__pycache__/app.cpython-311.pyc ADDED
Binary file (2.3 kB). View file
 
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_log import Log
3
+
4
+
5
+ with open("/tmp/test.log", "wb") as f:
6
+ # write some random log to f, with colored and uncolored text
7
+ f.write(b"[INFO] Everything is fine.\n")
8
+ f.write(b"\x1b[34m[DEBUG] Debugging information.\x1b[0m\n")
9
+ f.write(b"\x1b[32m[SUCCESS] Task completed successfully.\x1b[0m\n")
10
+ f.write(b"\x1b[33m[WARNING] Something is not right.\x1b[0m\n")
11
+ f.write(b"\x1b[31m[ERROR] Unexpected error occured.\x1b[0m\n")
12
+
13
+
14
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
15
+ with gr.Row():
16
+ with gr.Column(scale=1):
17
+ Log("/tmp/test.log")
18
+ with gr.Column(scale=1):
19
+ Log(
20
+ "/tmp/test.log",
21
+ dark=True,
22
+ tail=4,
23
+ label="dark mode, read from last 4 lines of log",
24
+ )
25
+
26
+
27
+ if __name__ == "__main__":
28
+ demo.launch()
css.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ font-family: Inter;
3
+ font-size: 16px;
4
+ font-weight: 400;
5
+ line-height: 1.5;
6
+ -webkit-text-size-adjust: 100%;
7
+ background: #fff;
8
+ color: #323232;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ text-rendering: optimizeLegibility;
12
+ }
13
+
14
+ :root {
15
+ --space: 1;
16
+ --vspace: calc(var(--space) * 1rem);
17
+ --vspace-0: calc(3 * var(--space) * 1rem);
18
+ --vspace-1: calc(2 * var(--space) * 1rem);
19
+ --vspace-2: calc(1.5 * var(--space) * 1rem);
20
+ --vspace-3: calc(0.5 * var(--space) * 1rem);
21
+ }
22
+
23
+ .app {
24
+ max-width: 748px !important;
25
+ }
26
+
27
+ .prose p {
28
+ margin: var(--vspace) 0;
29
+ line-height: var(--vspace * 2);
30
+ font-size: 1rem;
31
+ }
32
+
33
+ code {
34
+ font-family: "Inconsolata", sans-serif;
35
+ font-size: 16px;
36
+ }
37
+
38
+ h1,
39
+ h1 code {
40
+ font-weight: 400;
41
+ line-height: calc(2.5 / var(--space) * var(--vspace));
42
+ }
43
+
44
+ h1 code {
45
+ background: none;
46
+ border: none;
47
+ letter-spacing: 0.05em;
48
+ padding-bottom: 5px;
49
+ position: relative;
50
+ padding: 0;
51
+ }
52
+
53
+ h2 {
54
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
55
+ line-height: 1em;
56
+ }
57
+
58
+ h3,
59
+ h3 code {
60
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
61
+ line-height: 1em;
62
+ }
63
+
64
+ h4,
65
+ h5,
66
+ h6 {
67
+ margin: var(--vspace-3) 0 var(--vspace-3) 0;
68
+ line-height: var(--vspace);
69
+ }
70
+
71
+ .bigtitle,
72
+ h1,
73
+ h1 code {
74
+ font-size: calc(8px * 4.5);
75
+ word-break: break-word;
76
+ }
77
+
78
+ .title,
79
+ h2,
80
+ h2 code {
81
+ font-size: calc(8px * 3.375);
82
+ font-weight: lighter;
83
+ word-break: break-word;
84
+ border: none;
85
+ background: none;
86
+ }
87
+
88
+ .subheading1,
89
+ h3,
90
+ h3 code {
91
+ font-size: calc(8px * 1.8);
92
+ font-weight: 600;
93
+ border: none;
94
+ background: none;
95
+ letter-spacing: 0.1em;
96
+ text-transform: uppercase;
97
+ }
98
+
99
+ h2 code {
100
+ padding: 0;
101
+ position: relative;
102
+ letter-spacing: 0.05em;
103
+ }
104
+
105
+ blockquote {
106
+ font-size: calc(8px * 1.1667);
107
+ font-style: italic;
108
+ line-height: calc(1.1667 * var(--vspace));
109
+ margin: var(--vspace-2) var(--vspace-2);
110
+ }
111
+
112
+ .subheading2,
113
+ h4 {
114
+ font-size: calc(8px * 1.4292);
115
+ text-transform: uppercase;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .subheading3,
120
+ h5 {
121
+ font-size: calc(8px * 1.2917);
122
+ line-height: calc(1.2917 * var(--vspace));
123
+
124
+ font-weight: lighter;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.15em;
127
+ }
128
+
129
+ h6 {
130
+ font-size: calc(8px * 1.1667);
131
+ font-size: 1.1667em;
132
+ font-weight: normal;
133
+ font-style: italic;
134
+ font-family: "le-monde-livre-classic-byol", serif !important;
135
+ letter-spacing: 0px !important;
136
+ }
137
+
138
+ #start .md > *:first-child {
139
+ margin-top: 0;
140
+ }
141
+
142
+ h2 + h3 {
143
+ margin-top: 0;
144
+ }
145
+
146
+ .md hr {
147
+ border: none;
148
+ border-top: 1px solid var(--block-border-color);
149
+ margin: var(--vspace-2) 0 var(--vspace-2) 0;
150
+ }
151
+ .prose ul {
152
+ margin: var(--vspace-2) 0 var(--vspace-1) 0;
153
+ }
154
+
155
+ .gap {
156
+ gap: 0;
157
+ }
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio_log==0.0.1
space.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from app import demo as app
4
+ import os
5
+
6
+ _docs = {'Log': {'description': 'Create a log component which can continuously read from a log file and display the content in a container.', 'members': {'__init__': {'log_file': {'type': 'str', 'default': 'None', 'description': 'the log file path to read from.'}, 'tail': {'type': 'int', 'default': '100', 'description': 'from the end of the file, the number of lines to start read from.'}, 'dark': {'type': 'bool', 'default': 'False', 'description': 'if True, will render the component in dark mode.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': 'additional component description.'}, 'every': {'type': 'float', 'default': '0.3', 'description': 'New log pulling interval.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}}, 'postprocess': {}, 'preprocess': {'return': {'type': 'typing.Any', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'load': {'type': None, 'default': None, 'description': 'This listener is triggered when the Log initially loads in the browser.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'Log': []}}}
7
+
8
+ abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
+
10
+ with gr.Blocks(
11
+ css=abs_path,
12
+ theme=gr.themes.Default(
13
+ font_mono=[
14
+ gr.themes.GoogleFont("Inconsolata"),
15
+ "monospace",
16
+ ],
17
+ ),
18
+ ) as demo:
19
+ gr.Markdown(
20
+ """
21
+ # `gradio_log`
22
+
23
+ <div style="display: flex; gap: 7px;">
24
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
25
+ </div>
26
+
27
+ Python library for easily interacting with trained machine learning models
28
+ """, elem_classes=["md-custom"], header_links=True)
29
+ app.render()
30
+ gr.Markdown(
31
+ """
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install gradio_log
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import gradio as gr
42
+ from gradio_log import Log
43
+
44
+
45
+ with open("/tmp/test.log", "wb") as f:
46
+ # write some random log to f, with colored and uncolored text
47
+ f.write(b"[INFO] Everything is fine.\n")
48
+ f.write(b"\x1b[34m[DEBUG] Debugging information.\x1b[0m\n")
49
+ f.write(b"\x1b[32m[SUCCESS] Task completed successfully.\x1b[0m\n")
50
+ f.write(b"\x1b[33m[WARNING] Something is not right.\x1b[0m\n")
51
+ f.write(b"\x1b[31m[ERROR] Unexpected error occured.\x1b[0m\n")
52
+
53
+
54
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
55
+ with gr.Row():
56
+ with gr.Column(scale=1):
57
+ Log("/tmp/test.log")
58
+ with gr.Column(scale=1):
59
+ Log(
60
+ "/tmp/test.log",
61
+ dark=True,
62
+ tail=4,
63
+ label="dark mode, read from last 4 lines of log",
64
+ )
65
+
66
+
67
+ if __name__ == "__main__":
68
+ demo.launch()
69
+
70
+ ```
71
+ """, elem_classes=["md-custom"], header_links=True)
72
+
73
+
74
+ gr.Markdown("""
75
+ ## `Log`
76
+
77
+ ### Initialization
78
+ """, elem_classes=["md-custom"], header_links=True)
79
+
80
+ gr.ParamViewer(value=_docs["Log"]["members"]["__init__"], linkify=[])
81
+
82
+
83
+ gr.Markdown("### Events")
84
+ gr.ParamViewer(value=_docs["Log"]["events"], linkify=['Event'])
85
+
86
+
87
+
88
+
89
+ gr.Markdown("""
90
+
91
+ ### User function
92
+
93
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
94
+
95
+ - When used as an Input, the component only impacts the input signature of the user function.
96
+ - When used as an output, the component only impacts the return signature of the user function.
97
+
98
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
99
+
100
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
101
+
102
+
103
+ ```python
104
+ def predict(
105
+ value: typing.Any
106
+ ) -> Unknown:
107
+ return value
108
+ ```
109
+ """, elem_classes=["md-custom", "Log-user-fn"], header_links=True)
110
+
111
+
112
+
113
+
114
+ demo.load(None, js=r"""function() {
115
+ const refs = {};
116
+ const user_fn_refs = {
117
+ Log: [], };
118
+ requestAnimationFrame(() => {
119
+
120
+ Object.entries(user_fn_refs).forEach(([key, refs]) => {
121
+ if (refs.length > 0) {
122
+ const el = document.querySelector(`.${key}-user-fn`);
123
+ if (!el) return;
124
+ refs.forEach(ref => {
125
+ el.innerHTML = el.innerHTML.replace(
126
+ new RegExp("\\b"+ref+"\\b", "g"),
127
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
128
+ );
129
+ })
130
+ }
131
+ })
132
+
133
+ Object.entries(refs).forEach(([key, refs]) => {
134
+ if (refs.length > 0) {
135
+ const el = document.querySelector(`.${key}`);
136
+ if (!el) return;
137
+ refs.forEach(ref => {
138
+ el.innerHTML = el.innerHTML.replace(
139
+ new RegExp("\\b"+ref+"\\b", "g"),
140
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
141
+ );
142
+ })
143
+ }
144
+ })
145
+ })
146
+ }
147
+
148
+ """)
149
+
150
+ demo.launch()
src/.gitignore ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ .eggs/
2
+ dist/
3
+ *.pyc
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+ __tmp/*
8
+ *.pyi
9
+ node_modules
src/README.md ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # `gradio_log`
3
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
4
+
5
+ Python library for easily interacting with trained machine learning models
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install gradio_log
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```python
16
+ import gradio as gr
17
+ from gradio_log import Log
18
+
19
+
20
+ with open("/tmp/test.log", "wb") as f:
21
+ # write some random log to f, with colored and uncolored text
22
+ f.write(b"[INFO] Everything is fine.\n")
23
+ f.write(b"\x1b[34m[DEBUG] Debugging information.\x1b[0m\n")
24
+ f.write(b"\x1b[32m[SUCCESS] Task completed successfully.\x1b[0m\n")
25
+ f.write(b"\x1b[33m[WARNING] Something is not right.\x1b[0m\n")
26
+ f.write(b"\x1b[31m[ERROR] Unexpected error occured.\x1b[0m\n")
27
+
28
+
29
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
30
+ with gr.Row():
31
+ with gr.Column(scale=1):
32
+ Log("/tmp/test.log")
33
+ with gr.Column(scale=1):
34
+ Log(
35
+ "/tmp/test.log",
36
+ dark=True,
37
+ tail=4,
38
+ label="dark mode, read from last 4 lines of log",
39
+ )
40
+
41
+
42
+ if __name__ == "__main__":
43
+ demo.launch()
44
+
45
+ ```
46
+
47
+ ## `Log`
48
+
49
+ ### Initialization
50
+
51
+ <table>
52
+ <thead>
53
+ <tr>
54
+ <th align="left">name</th>
55
+ <th align="left" style="width: 25%;">type</th>
56
+ <th align="left">default</th>
57
+ <th align="left">description</th>
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr>
62
+ <td align="left"><code>log_file</code></td>
63
+ <td align="left" style="width: 25%;">
64
+
65
+ ```python
66
+ str
67
+ ```
68
+
69
+ </td>
70
+ <td align="left"><code>None</code></td>
71
+ <td align="left">the log file path to read from.</td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td align="left"><code>tail</code></td>
76
+ <td align="left" style="width: 25%;">
77
+
78
+ ```python
79
+ int
80
+ ```
81
+
82
+ </td>
83
+ <td align="left"><code>100</code></td>
84
+ <td align="left">from the end of the file, the number of lines to start read from.</td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td align="left"><code>dark</code></td>
89
+ <td align="left" style="width: 25%;">
90
+
91
+ ```python
92
+ bool
93
+ ```
94
+
95
+ </td>
96
+ <td align="left"><code>False</code></td>
97
+ <td align="left">if True, will render the component in dark mode.</td>
98
+ </tr>
99
+
100
+ <tr>
101
+ <td align="left"><code>label</code></td>
102
+ <td align="left" style="width: 25%;">
103
+
104
+ ```python
105
+ str | None
106
+ ```
107
+
108
+ </td>
109
+ <td align="left"><code>None</code></td>
110
+ <td align="left">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td align="left"><code>info</code></td>
115
+ <td align="left" style="width: 25%;">
116
+
117
+ ```python
118
+ str | None
119
+ ```
120
+
121
+ </td>
122
+ <td align="left"><code>None</code></td>
123
+ <td align="left">additional component description.</td>
124
+ </tr>
125
+
126
+ <tr>
127
+ <td align="left"><code>every</code></td>
128
+ <td align="left" style="width: 25%;">
129
+
130
+ ```python
131
+ float
132
+ ```
133
+
134
+ </td>
135
+ <td align="left"><code>0.3</code></td>
136
+ <td align="left">New log pulling interval.</td>
137
+ </tr>
138
+
139
+ <tr>
140
+ <td align="left"><code>show_label</code></td>
141
+ <td align="left" style="width: 25%;">
142
+
143
+ ```python
144
+ bool | None
145
+ ```
146
+
147
+ </td>
148
+ <td align="left"><code>None</code></td>
149
+ <td align="left">if True, will display label.</td>
150
+ </tr>
151
+
152
+ <tr>
153
+ <td align="left"><code>container</code></td>
154
+ <td align="left" style="width: 25%;">
155
+
156
+ ```python
157
+ bool
158
+ ```
159
+
160
+ </td>
161
+ <td align="left"><code>True</code></td>
162
+ <td align="left">If True, will place the component in a container - providing some extra padding around the border.</td>
163
+ </tr>
164
+
165
+ <tr>
166
+ <td align="left"><code>scale</code></td>
167
+ <td align="left" style="width: 25%;">
168
+
169
+ ```python
170
+ int | None
171
+ ```
172
+
173
+ </td>
174
+ <td align="left"><code>None</code></td>
175
+ <td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
176
+ </tr>
177
+
178
+ <tr>
179
+ <td align="left"><code>min_width</code></td>
180
+ <td align="left" style="width: 25%;">
181
+
182
+ ```python
183
+ int
184
+ ```
185
+
186
+ </td>
187
+ <td align="left"><code>160</code></td>
188
+ <td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
189
+ </tr>
190
+
191
+ <tr>
192
+ <td align="left"><code>interactive</code></td>
193
+ <td align="left" style="width: 25%;">
194
+
195
+ ```python
196
+ bool | None
197
+ ```
198
+
199
+ </td>
200
+ <td align="left"><code>None</code></td>
201
+ <td align="left">if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>
202
+ </tr>
203
+
204
+ <tr>
205
+ <td align="left"><code>visible</code></td>
206
+ <td align="left" style="width: 25%;">
207
+
208
+ ```python
209
+ bool
210
+ ```
211
+
212
+ </td>
213
+ <td align="left"><code>True</code></td>
214
+ <td align="left">If False, component will be hidden.</td>
215
+ </tr>
216
+
217
+ <tr>
218
+ <td align="left"><code>elem_id</code></td>
219
+ <td align="left" style="width: 25%;">
220
+
221
+ ```python
222
+ str | None
223
+ ```
224
+
225
+ </td>
226
+ <td align="left"><code>None</code></td>
227
+ <td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
228
+ </tr>
229
+
230
+ <tr>
231
+ <td align="left"><code>elem_classes</code></td>
232
+ <td align="left" style="width: 25%;">
233
+
234
+ ```python
235
+ list[str] | str | None
236
+ ```
237
+
238
+ </td>
239
+ <td align="left"><code>None</code></td>
240
+ <td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
241
+ </tr>
242
+
243
+ <tr>
244
+ <td align="left"><code>render</code></td>
245
+ <td align="left" style="width: 25%;">
246
+
247
+ ```python
248
+ bool
249
+ ```
250
+
251
+ </td>
252
+ <td align="left"><code>True</code></td>
253
+ <td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
254
+ </tr>
255
+ </tbody></table>
256
+
257
+
258
+ ### Events
259
+
260
+ | name | description |
261
+ |:-----|:------------|
262
+ | `load` | This listener is triggered when the Log initially loads in the browser. |
263
+
264
+
265
+
266
+ ### User function
267
+
268
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
269
+
270
+ - When used as an Input, the component only impacts the input signature of the user function.
271
+ - When used as an output, the component only impacts the return signature of the user function.
272
+
273
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
274
+
275
+ - **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.
276
+
277
+
278
+ ```python
279
+ def predict(
280
+ value: typing.Any
281
+ ) -> Unknown:
282
+ return value
283
+ ```
284
+
src/backend/gradio_log/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from .log import Log
2
+
3
+ __all__ = ["Log"]
src/backend/gradio_log/log.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Log component of Gradio."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import time
6
+ from typing import Any
7
+
8
+ from gradio.components.base import FormComponent
9
+ from gradio.events import Events
10
+ from gradio_client.documentation import document
11
+
12
+
13
+ @document()
14
+ class Log(FormComponent):
15
+ """
16
+ Create a log component which can continuously read from a log file and display the content in a container.
17
+ """
18
+
19
+ EVENTS = [Events.load]
20
+
21
+ def find_start_position(self) -> int:
22
+ self.io.seek(0, 2)
23
+ file_size = self.io.tell()
24
+ lines_found = 0
25
+ block_size = 1024
26
+ blocks = []
27
+
28
+ while self.io.tell() > 0 and lines_found <= self.tail:
29
+ self.io.seek(max(self.io.tell() - block_size, 0))
30
+ block = self.io.read(block_size)
31
+ blocks.append(block)
32
+ lines_found += block.count(b"\n")
33
+ self.io.seek(-len(block), 1)
34
+
35
+ all_read_bytes = b"".join(reversed(blocks))
36
+ lines = all_read_bytes.splitlines()
37
+
38
+ if self.tail >= len(lines):
39
+ return 0
40
+ last_lines = b"\n".join(lines[-self.tail :])
41
+ return file_size - len(last_lines) - 1
42
+
43
+ def read_to_end(self) -> bytes:
44
+ if self.current_pos is None:
45
+ return None
46
+ if self.stop_reading:
47
+ return None
48
+ self.io.seek(self.current_pos)
49
+ b = self.io.read().decode()
50
+ self.current_pos = self.io.tell()
51
+ return b
52
+
53
+ def __init__(
54
+ self,
55
+ log_file: str = None,
56
+ tail: int = 100,
57
+ dark: bool = False,
58
+ *,
59
+ label: str | None = None,
60
+ info: str | None = None,
61
+ every: float = 0.3,
62
+ show_label: bool | None = None,
63
+ container: bool = True,
64
+ scale: int | None = None,
65
+ min_width: int = 160,
66
+ interactive: bool | None = None,
67
+ visible: bool = True,
68
+ elem_id: str | None = None,
69
+ elem_classes: list[str] | str | None = None,
70
+ render: bool = True,
71
+ ):
72
+ """
73
+ Parameters:
74
+ log_file: the log file path to read from.
75
+ tail: from the end of the file, the number of lines to start read from.
76
+ dark: if True, will render the component in dark mode.
77
+ label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
78
+ info: additional component description.
79
+ every: New log pulling interval.
80
+ show_label: if True, will display label.
81
+ container: If True, will place the component in a container - providing some extra padding around the border.
82
+ scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
83
+ min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
84
+ interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
85
+ visible: If False, component will be hidden.
86
+ elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
87
+ elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
88
+ render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
89
+ """
90
+ self.log_file = log_file
91
+ self.tail = tail
92
+ self.dark = dark
93
+ self.current_pos = None
94
+ self.fd = None
95
+ self.stop_reading = False
96
+
97
+ super().__init__(
98
+ label=label,
99
+ info=info,
100
+ every=every,
101
+ show_label=show_label,
102
+ container=container,
103
+ scale=scale,
104
+ min_width=min_width,
105
+ interactive=interactive,
106
+ visible=visible,
107
+ elem_id=elem_id,
108
+ elem_classes=elem_classes,
109
+ render=render,
110
+ value=self.read_to_end,
111
+ )
112
+
113
+ self.load(self.handle_load_event)
114
+
115
+ def handle_load_event(self):
116
+ # prevent race condition
117
+ self.stop_reading = True
118
+ time.sleep(1)
119
+ self.io = open(self.log_file, "rb")
120
+ self.current_pos = self.find_start_position()
121
+ self.stop_reading = False
122
+
123
+ def api_info(self) -> dict[str, Any]:
124
+ return {"type": "string"}
125
+
126
+ def example_payload(self) -> Any:
127
+ return "Hello!!"
128
+
129
+ def example_value(self) -> Any:
130
+ return "Hello!!"
src/backend/gradio_log/log.pyi ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from typing import Any, Callable
4
+
5
+ from gradio.components.base import FormComponent
6
+ from gradio.events import Events
7
+
8
+
9
+ class log(FormComponent):
10
+
11
+ def find_start_position(self) -> int:
12
+ self.io.seek(0, 2)
13
+ file_size = self.io.tell()
14
+ lines_found = 0
15
+ block_size = 1024
16
+ blocks = []
17
+
18
+ while self.io.tell() > 0 and lines_found <= self.tail:
19
+ self.io.seek(max(self.io.tell() - block_size, 0))
20
+ block = self.io.read(min(block_size, self.io.tell()))
21
+ blocks.append(block)
22
+ lines_found += block.count(b"\n")
23
+ self.io.seek(-len(block), 1)
24
+
25
+ all_read_bytes = b"".join(reversed(blocks))
26
+ lines = all_read_bytes.splitlines()
27
+
28
+ if self.tail >= len(lines):
29
+ return 0
30
+ last_lines = b"\n".join(lines[-self.tail :])
31
+ return file_size - len(last_lines)
32
+
33
+ def read_to_end(self) -> bytes:
34
+ print(
35
+ "read to end called, current pos: ",
36
+ self.current_pos,
37
+ " self id: ",
38
+ id(self.io),
39
+ )
40
+ self.io.seek(self.current_pos)
41
+ b = self.io.read().decode()
42
+ self.current_pos = self.io.tell()
43
+ return b
44
+
45
+ def __init__(
46
+ self,
47
+ io: IO,
48
+ tail: int = 100,
49
+ *,
50
+ label: str | None = None,
51
+ info: str | None = None,
52
+ every: float | None = None,
53
+ show_label: bool | None = None,
54
+ container: bool = True,
55
+ scale: int | None = None,
56
+ min_width: int = 160,
57
+ interactive: bool | None = None,
58
+ visible: bool = True,
59
+ elem_id: str | None = None,
60
+ elem_classes: list[str] | str | None = None,
61
+ render: bool = True,
62
+ ):
63
+ """
64
+ Parameters:
65
+ io: the log io to read from
66
+ tail: from the end of the file, the number of lines to start read from
67
+ value: default text to provide in textarea. If callable, the function will be called whenever the app loads to set the initial value of the component.
68
+ label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
69
+ info: additional component description.
70
+ every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
71
+ show_label: if True, will display label.
72
+ container: If True, will place the component in a container - providing some extra padding around the border.
73
+ scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
74
+ min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
75
+ interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
76
+ visible: If False, component will be hidden.
77
+ elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
78
+ elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
79
+ render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
80
+ """
81
+ every = 1
82
+ self.io = io
83
+ self.tail = tail
84
+ self.current_pos = self.find_start_position()
85
+ value = self.read_to_end
86
+
87
+ super().__init__(
88
+ label=label,
89
+ info=info,
90
+ every=every,
91
+ show_label=show_label,
92
+ container=container,
93
+ scale=scale,
94
+ min_width=min_width,
95
+ interactive=interactive,
96
+ visible=visible,
97
+ elem_id=elem_id,
98
+ elem_classes=elem_classes,
99
+ render=render,
100
+ value=value,
101
+ )
102
+
103
+ def preprocess(self, payload: str | None) -> str | None:
104
+ """
105
+ Parameters:
106
+ payload: the text entered in the textarea.
107
+ Returns:
108
+ Passes text value as a {str} into the function.
109
+ """
110
+ return None if payload is None else str(payload)
111
+
112
+ def postprocess(self, value: str | None) -> str | None:
113
+ """
114
+ Parameters:
115
+ value: Expects a {str} returned from function and sets textarea value to it.
116
+ Returns:
117
+ The value to display in the textarea.
118
+ """
119
+ return None if value is None else str(value)
120
+
121
+ def api_info(self) -> dict[str, Any]:
122
+ return {"type": "string"}
123
+
124
+ def example_payload(self) -> Any:
125
+ return "Hello!!"
126
+
127
+ def example_value(self) -> Any:
128
+ return "Hello!!"
129
+
130
+ class Log(FormComponent):
131
+ """
132
+ Create a log component which can continuously read from a log file and display the content in a container.
133
+ """
134
+
135
+ EVENTS = [Events.load]
136
+
137
+ def find_start_position(self) -> int:
138
+ self.io.seek(0, 2)
139
+ file_size = self.io.tell()
140
+ lines_found = 0
141
+ block_size = 1024
142
+ blocks = []
143
+
144
+ while self.io.tell() > 0 and lines_found <= self.tail:
145
+ self.io.seek(max(self.io.tell() - block_size, 0))
146
+ block = self.io.read(block_size)
147
+ blocks.append(block)
148
+ lines_found += block.count(b"\n")
149
+ self.io.seek(-len(block), 1)
150
+
151
+ all_read_bytes = b"".join(reversed(blocks))
152
+ lines = all_read_bytes.splitlines()
153
+
154
+ if self.tail >= len(lines):
155
+ return 0
156
+ last_lines = b"\n".join(lines[-self.tail :])
157
+ return file_size - len(last_lines) - 1
158
+
159
+ def read_to_end(self) -> bytes:
160
+ if self.current_pos is None:
161
+ return None
162
+ if self.stop_reading:
163
+ return None
164
+ self.io.seek(self.current_pos)
165
+ b = self.io.read().decode()
166
+ self.current_pos = self.io.tell()
167
+ return b
168
+
169
+ def __init__(
170
+ self,
171
+ log_file: str = None,
172
+ tail: int = 100,
173
+ dark: bool = False,
174
+ *,
175
+ label: str | None = None,
176
+ info: str | None = None,
177
+ every: float = 0.3,
178
+ show_label: bool | None = None,
179
+ container: bool = True,
180
+ scale: int | None = None,
181
+ min_width: int = 160,
182
+ interactive: bool | None = None,
183
+ visible: bool = True,
184
+ elem_id: str | None = None,
185
+ elem_classes: list[str] | str | None = None,
186
+ render: bool = True,
187
+ ):
188
+ """
189
+ Parameters:
190
+ log_file: the log file path to read from.
191
+ tail: from the end of the file, the number of lines to start read from.
192
+ dark: if True, will render the component in dark mode.
193
+ label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
194
+ info: additional component description.
195
+ every: New log pulling interval.
196
+ show_label: if True, will display label.
197
+ container: If True, will place the component in a container - providing some extra padding around the border.
198
+ scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
199
+ min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
200
+ interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
201
+ visible: If False, component will be hidden.
202
+ elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
203
+ elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
204
+ render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
205
+ """
206
+ self.log_file = log_file
207
+ self.tail = tail
208
+ self.dark = dark
209
+ self.current_pos = None
210
+ self.fd = None
211
+ self.stop_reading = False
212
+
213
+ super().__init__(
214
+ label=label,
215
+ info=info,
216
+ every=every,
217
+ show_label=show_label,
218
+ container=container,
219
+ scale=scale,
220
+ min_width=min_width,
221
+ interactive=interactive,
222
+ visible=visible,
223
+ elem_id=elem_id,
224
+ elem_classes=elem_classes,
225
+ render=render,
226
+ value=self.read_to_end,
227
+ )
228
+
229
+ self.load(self.handle_load_event)
230
+
231
+ def handle_load_event(self):
232
+ # prevent race condition
233
+ self.stop_reading = True
234
+ time.sleep(1)
235
+ self.io = open(self.log_file, "rb")
236
+ self.current_pos = self.find_start_position()
237
+ self.stop_reading = False
238
+
239
+ def api_info(self) -> dict[str, Any]:
240
+ return {"type": "string"}
241
+
242
+ def example_payload(self) -> Any:
243
+ return "Hello!!"
244
+
245
+ def example_value(self) -> Any:
246
+ return "Hello!!"
247
+
248
+
249
+ def load(self,
250
+ fn: Callable | None,
251
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
252
+ outputs: Component | Sequence[Component] | None = None,
253
+ api_name: str | None | Literal[False] = None,
254
+ scroll_to_output: bool = False,
255
+ show_progress: Literal["full", "minimal", "hidden"] = "full",
256
+ queue: bool | None = None,
257
+ batch: bool = False,
258
+ max_batch_size: int = 4,
259
+ preprocess: bool = True,
260
+ postprocess: bool = True,
261
+ cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
262
+ every: float | None = None,
263
+ trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
264
+ js: str | None = None,
265
+ concurrency_limit: int | None | Literal["default"] = "default",
266
+ concurrency_id: str | None = None,
267
+ show_api: bool = True) -> Dependency:
268
+ """
269
+ Parameters:
270
+ 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.
271
+ inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
272
+ outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
273
+ 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.
274
+ scroll_to_output: If True, will scroll to output component on completion
275
+ show_progress: If True, will show progress animation while pending
276
+ 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.
277
+ 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.
278
+ max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
279
+ 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).
280
+ postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
281
+ 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.
282
+ every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
283
+ 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.
284
+ 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.
285
+ 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).
286
+ 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.
287
+ 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.
288
+ """
289
+ ...
290
+
291
+
src/backend/gradio_log/templates/component/index.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_log/templates/component/style.css ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .block.svelte-nl1om8{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-nl1om8{border-color:var(--color-accent)}.block.border_contrast.svelte-nl1om8{border-color:var(--body-text-color)}.padded.svelte-nl1om8{padding:var(--block-padding)}.hidden.svelte-nl1om8{display:none}.hide-container.svelte-nl1om8{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1yserjw.svelte-1yserjw{top:0;right:0;left:0}.wrap.default.svelte-1yserjw.svelte-1yserjw{top:0;right:0;bottom:0;left:0}.hide.svelte-1yserjw.svelte-1yserjw{opacity:0;pointer-events:none}.generating.svelte-1yserjw.svelte-1yserjw{animation:svelte-1yserjw-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent;z-index:var(--layer-1)}.translucent.svelte-1yserjw.svelte-1yserjw{background:none}@keyframes svelte-1yserjw-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1yserjw.svelte-1yserjw{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1yserjw.svelte-1yserjw{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1yserjw.svelte-1yserjw{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1yserjw.svelte-1yserjw{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1yserjw.svelte-1yserjw{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1yserjw .progress-text.svelte-1yserjw{background:var(--block-background-fill)}.border.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}/**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.svelte-1jxdgz3 .xterm .xterm-viewport{overflow-y:auto!important}
src/demo/__init__.py ADDED
File without changes
src/demo/app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_log import Log
3
+
4
+
5
+ with open("/tmp/test.log", "wb") as f:
6
+ # write some random log to f, with colored and uncolored text
7
+ f.write(b"[INFO] Everything is fine.\n")
8
+ f.write(b"\x1b[34m[DEBUG] Debugging information.\x1b[0m\n")
9
+ f.write(b"\x1b[32m[SUCCESS] Task completed successfully.\x1b[0m\n")
10
+ f.write(b"\x1b[33m[WARNING] Something is not right.\x1b[0m\n")
11
+ f.write(b"\x1b[31m[ERROR] Unexpected error occured.\x1b[0m\n")
12
+
13
+
14
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
15
+ with gr.Row():
16
+ with gr.Column(scale=1):
17
+ Log("/tmp/test.log")
18
+ with gr.Column(scale=1):
19
+ Log(
20
+ "/tmp/test.log",
21
+ dark=True,
22
+ tail=4,
23
+ label="dark mode, read from last 4 lines of log",
24
+ )
25
+
26
+
27
+ if __name__ == "__main__":
28
+ demo.launch()
src/demo/css.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ font-family: Inter;
3
+ font-size: 16px;
4
+ font-weight: 400;
5
+ line-height: 1.5;
6
+ -webkit-text-size-adjust: 100%;
7
+ background: #fff;
8
+ color: #323232;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ text-rendering: optimizeLegibility;
12
+ }
13
+
14
+ :root {
15
+ --space: 1;
16
+ --vspace: calc(var(--space) * 1rem);
17
+ --vspace-0: calc(3 * var(--space) * 1rem);
18
+ --vspace-1: calc(2 * var(--space) * 1rem);
19
+ --vspace-2: calc(1.5 * var(--space) * 1rem);
20
+ --vspace-3: calc(0.5 * var(--space) * 1rem);
21
+ }
22
+
23
+ .app {
24
+ max-width: 748px !important;
25
+ }
26
+
27
+ .prose p {
28
+ margin: var(--vspace) 0;
29
+ line-height: var(--vspace * 2);
30
+ font-size: 1rem;
31
+ }
32
+
33
+ code {
34
+ font-family: "Inconsolata", sans-serif;
35
+ font-size: 16px;
36
+ }
37
+
38
+ h1,
39
+ h1 code {
40
+ font-weight: 400;
41
+ line-height: calc(2.5 / var(--space) * var(--vspace));
42
+ }
43
+
44
+ h1 code {
45
+ background: none;
46
+ border: none;
47
+ letter-spacing: 0.05em;
48
+ padding-bottom: 5px;
49
+ position: relative;
50
+ padding: 0;
51
+ }
52
+
53
+ h2 {
54
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
55
+ line-height: 1em;
56
+ }
57
+
58
+ h3,
59
+ h3 code {
60
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
61
+ line-height: 1em;
62
+ }
63
+
64
+ h4,
65
+ h5,
66
+ h6 {
67
+ margin: var(--vspace-3) 0 var(--vspace-3) 0;
68
+ line-height: var(--vspace);
69
+ }
70
+
71
+ .bigtitle,
72
+ h1,
73
+ h1 code {
74
+ font-size: calc(8px * 4.5);
75
+ word-break: break-word;
76
+ }
77
+
78
+ .title,
79
+ h2,
80
+ h2 code {
81
+ font-size: calc(8px * 3.375);
82
+ font-weight: lighter;
83
+ word-break: break-word;
84
+ border: none;
85
+ background: none;
86
+ }
87
+
88
+ .subheading1,
89
+ h3,
90
+ h3 code {
91
+ font-size: calc(8px * 1.8);
92
+ font-weight: 600;
93
+ border: none;
94
+ background: none;
95
+ letter-spacing: 0.1em;
96
+ text-transform: uppercase;
97
+ }
98
+
99
+ h2 code {
100
+ padding: 0;
101
+ position: relative;
102
+ letter-spacing: 0.05em;
103
+ }
104
+
105
+ blockquote {
106
+ font-size: calc(8px * 1.1667);
107
+ font-style: italic;
108
+ line-height: calc(1.1667 * var(--vspace));
109
+ margin: var(--vspace-2) var(--vspace-2);
110
+ }
111
+
112
+ .subheading2,
113
+ h4 {
114
+ font-size: calc(8px * 1.4292);
115
+ text-transform: uppercase;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .subheading3,
120
+ h5 {
121
+ font-size: calc(8px * 1.2917);
122
+ line-height: calc(1.2917 * var(--vspace));
123
+
124
+ font-weight: lighter;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.15em;
127
+ }
128
+
129
+ h6 {
130
+ font-size: calc(8px * 1.1667);
131
+ font-size: 1.1667em;
132
+ font-weight: normal;
133
+ font-style: italic;
134
+ font-family: "le-monde-livre-classic-byol", serif !important;
135
+ letter-spacing: 0px !important;
136
+ }
137
+
138
+ #start .md > *:first-child {
139
+ margin-top: 0;
140
+ }
141
+
142
+ h2 + h3 {
143
+ margin-top: 0;
144
+ }
145
+
146
+ .md hr {
147
+ border: none;
148
+ border-top: 1px solid var(--block-border-color);
149
+ margin: var(--vspace-2) 0 var(--vspace-2) 0;
150
+ }
151
+ .prose ul {
152
+ margin: var(--vspace-2) 0 var(--vspace-1) 0;
153
+ }
154
+
155
+ .gap {
156
+ gap: 0;
157
+ }
src/demo/space.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from app import demo as app
4
+ import os
5
+
6
+ _docs = {'Log': {'description': 'Create a log component which can continuously read from a log file and display the content in a container.', 'members': {'__init__': {'log_file': {'type': 'str', 'default': 'None', 'description': 'the log file path to read from.'}, 'tail': {'type': 'int', 'default': '100', 'description': 'from the end of the file, the number of lines to start read from.'}, 'dark': {'type': 'bool', 'default': 'False', 'description': 'if True, will render the component in dark mode.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': 'additional component description.'}, 'every': {'type': 'float', 'default': '0.3', 'description': 'New log pulling interval.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}}, 'postprocess': {}, 'preprocess': {'return': {'type': 'typing.Any', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'load': {'type': None, 'default': None, 'description': 'This listener is triggered when the Log initially loads in the browser.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'Log': []}}}
7
+
8
+ abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
+
10
+ with gr.Blocks(
11
+ css=abs_path,
12
+ theme=gr.themes.Default(
13
+ font_mono=[
14
+ gr.themes.GoogleFont("Inconsolata"),
15
+ "monospace",
16
+ ],
17
+ ),
18
+ ) as demo:
19
+ gr.Markdown(
20
+ """
21
+ # `gradio_log`
22
+
23
+ <div style="display: flex; gap: 7px;">
24
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
25
+ </div>
26
+
27
+ Python library for easily interacting with trained machine learning models
28
+ """, elem_classes=["md-custom"], header_links=True)
29
+ app.render()
30
+ gr.Markdown(
31
+ """
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install gradio_log
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import gradio as gr
42
+ from gradio_log import Log
43
+
44
+
45
+ with open("/tmp/test.log", "wb") as f:
46
+ # write some random log to f, with colored and uncolored text
47
+ f.write(b"[INFO] Everything is fine.\n")
48
+ f.write(b"\x1b[34m[DEBUG] Debugging information.\x1b[0m\n")
49
+ f.write(b"\x1b[32m[SUCCESS] Task completed successfully.\x1b[0m\n")
50
+ f.write(b"\x1b[33m[WARNING] Something is not right.\x1b[0m\n")
51
+ f.write(b"\x1b[31m[ERROR] Unexpected error occured.\x1b[0m\n")
52
+
53
+
54
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
55
+ with gr.Row():
56
+ with gr.Column(scale=1):
57
+ Log("/tmp/test.log")
58
+ with gr.Column(scale=1):
59
+ Log(
60
+ "/tmp/test.log",
61
+ dark=True,
62
+ tail=4,
63
+ label="dark mode, read from last 4 lines of log",
64
+ )
65
+
66
+
67
+ if __name__ == "__main__":
68
+ demo.launch()
69
+
70
+ ```
71
+ """, elem_classes=["md-custom"], header_links=True)
72
+
73
+
74
+ gr.Markdown("""
75
+ ## `Log`
76
+
77
+ ### Initialization
78
+ """, elem_classes=["md-custom"], header_links=True)
79
+
80
+ gr.ParamViewer(value=_docs["Log"]["members"]["__init__"], linkify=[])
81
+
82
+
83
+ gr.Markdown("### Events")
84
+ gr.ParamViewer(value=_docs["Log"]["events"], linkify=['Event'])
85
+
86
+
87
+
88
+
89
+ gr.Markdown("""
90
+
91
+ ### User function
92
+
93
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
94
+
95
+ - When used as an Input, the component only impacts the input signature of the user function.
96
+ - When used as an output, the component only impacts the return signature of the user function.
97
+
98
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
99
+
100
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
101
+
102
+
103
+ ```python
104
+ def predict(
105
+ value: typing.Any
106
+ ) -> Unknown:
107
+ return value
108
+ ```
109
+ """, elem_classes=["md-custom", "Log-user-fn"], header_links=True)
110
+
111
+
112
+
113
+
114
+ demo.load(None, js=r"""function() {
115
+ const refs = {};
116
+ const user_fn_refs = {
117
+ Log: [], };
118
+ requestAnimationFrame(() => {
119
+
120
+ Object.entries(user_fn_refs).forEach(([key, refs]) => {
121
+ if (refs.length > 0) {
122
+ const el = document.querySelector(`.${key}-user-fn`);
123
+ if (!el) return;
124
+ refs.forEach(ref => {
125
+ el.innerHTML = el.innerHTML.replace(
126
+ new RegExp("\\b"+ref+"\\b", "g"),
127
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
128
+ );
129
+ })
130
+ }
131
+ })
132
+
133
+ Object.entries(refs).forEach(([key, refs]) => {
134
+ if (refs.length > 0) {
135
+ const el = document.querySelector(`.${key}`);
136
+ if (!el) return;
137
+ refs.forEach(ref => {
138
+ el.innerHTML = el.innerHTML.replace(
139
+ new RegExp("\\b"+ref+"\\b", "g"),
140
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
141
+ );
142
+ })
143
+ }
144
+ })
145
+ })
146
+ }
147
+
148
+ """)
149
+
150
+ demo.launch()
src/frontend/Index.svelte ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svelte:options accessors={true} />
2
+
3
+ <script lang="ts">
4
+ import type { Gradio } from "@gradio/utils";
5
+ import { BlockTitle } from "@gradio/atoms";
6
+ import { Block } from "@gradio/atoms";
7
+ import { StatusTracker } from "@gradio/statustracker";
8
+ import type { LoadingStatus } from "@gradio/statustracker";
9
+ import xterm from "@xterm/xterm";
10
+ import addon from "xterm-addon-fit";
11
+ import { onMount } from "svelte";
12
+
13
+ export let gradio: Gradio<{
14
+ change: never;
15
+ submit: never;
16
+ input: never;
17
+ }>;
18
+ export let log_file = "";
19
+ export let label = `log of ${log_file}`;
20
+ export let dark = false;
21
+ export let elem_id = "";
22
+ export let elem_classes: string[] = ["terminal-block"];
23
+ export let visible = true;
24
+ export let value = "";
25
+ export let show_label: boolean;
26
+ export let scale: number | null = null;
27
+ export let min_width: number | undefined = undefined;
28
+ export let loading_status: LoadingStatus | undefined = undefined;
29
+
30
+ let term;
31
+ let termNode;
32
+
33
+ $: theme = dark
34
+ ? { foreground: "white", background: "#1F2937" }
35
+ : {
36
+ foreground: "#1F2937",
37
+ background: "white",
38
+ selectionBackground: "#e5e7eb",
39
+ };
40
+
41
+ onMount(() => {
42
+ term = new xterm.Terminal({
43
+ // allowTransparency: true,
44
+ theme,
45
+ });
46
+ term.open(termNode);
47
+ const fitAddon = new addon.FitAddon();
48
+ term.loadAddon(fitAddon);
49
+ setTimeout(() => {
50
+ fitAddon.fit();
51
+ }, 300);
52
+ });
53
+
54
+ $: if (term && value) {
55
+ if (value.trim() !== "") {
56
+ term.write(value.replace(/\n/g, "\n\r"));
57
+ }
58
+ }
59
+ </script>
60
+
61
+ <Block
62
+ {visible}
63
+ {elem_id}
64
+ {scale}
65
+ {min_width}
66
+ elem_classes={[...elem_classes, dark ? "dark" : ""]}
67
+ allow_overflow={false}
68
+ padding={true}
69
+ >
70
+ {#if loading_status}
71
+ <StatusTracker
72
+ autoscroll={gradio.autoscroll}
73
+ i18n={gradio.i18n}
74
+ {...loading_status}
75
+ />
76
+ {/if}
77
+ <div>
78
+ <BlockTitle {show_label} info={undefined}>{label}</BlockTitle>
79
+ <div bind:this={termNode}></div>
80
+ </div>
81
+ </Block>
82
+
83
+ <style>
84
+ @import "./node_modules/@xterm/xterm/css/xterm.css";
85
+ * :global(.xterm .xterm-viewport) {
86
+ overflow-y: auto !important;
87
+ }
88
+ </style>
src/frontend/package-lock.json ADDED
@@ -0,0 +1,972 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gradio_log",
3
+ "version": "0.1.13",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "gradio_log",
9
+ "version": "0.1.13",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@gradio/atoms": "0.6.1",
13
+ "@gradio/icons": "0.3.4",
14
+ "@gradio/statustracker": "0.4.10",
15
+ "@gradio/utils": "0.3.0",
16
+ "@xterm/xterm": "^5.5.0",
17
+ "xterm-addon-fit": "^0.8.0"
18
+ }
19
+ },
20
+ "node_modules/@ampproject/remapping": {
21
+ "version": "2.3.0",
22
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@ampproject/remapping/-/remapping-2.3.0.tgz",
23
+ "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
24
+ "peer": true,
25
+ "dependencies": {
26
+ "@jridgewell/gen-mapping": "^0.3.5",
27
+ "@jridgewell/trace-mapping": "^0.3.24"
28
+ },
29
+ "engines": {
30
+ "node": ">=6.0.0"
31
+ }
32
+ },
33
+ "node_modules/@esbuild/aix-ppc64": {
34
+ "version": "0.19.12",
35
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
36
+ "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
37
+ "cpu": [
38
+ "ppc64"
39
+ ],
40
+ "optional": true,
41
+ "os": [
42
+ "aix"
43
+ ],
44
+ "engines": {
45
+ "node": ">=12"
46
+ }
47
+ },
48
+ "node_modules/@esbuild/android-arm": {
49
+ "version": "0.19.12",
50
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
51
+ "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
52
+ "cpu": [
53
+ "arm"
54
+ ],
55
+ "optional": true,
56
+ "os": [
57
+ "android"
58
+ ],
59
+ "engines": {
60
+ "node": ">=12"
61
+ }
62
+ },
63
+ "node_modules/@esbuild/android-arm64": {
64
+ "version": "0.19.12",
65
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
66
+ "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
67
+ "cpu": [
68
+ "arm64"
69
+ ],
70
+ "optional": true,
71
+ "os": [
72
+ "android"
73
+ ],
74
+ "engines": {
75
+ "node": ">=12"
76
+ }
77
+ },
78
+ "node_modules/@esbuild/android-x64": {
79
+ "version": "0.19.12",
80
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
81
+ "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
82
+ "cpu": [
83
+ "x64"
84
+ ],
85
+ "optional": true,
86
+ "os": [
87
+ "android"
88
+ ],
89
+ "engines": {
90
+ "node": ">=12"
91
+ }
92
+ },
93
+ "node_modules/@esbuild/darwin-arm64": {
94
+ "version": "0.19.12",
95
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
96
+ "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
97
+ "cpu": [
98
+ "arm64"
99
+ ],
100
+ "optional": true,
101
+ "os": [
102
+ "darwin"
103
+ ],
104
+ "engines": {
105
+ "node": ">=12"
106
+ }
107
+ },
108
+ "node_modules/@esbuild/darwin-x64": {
109
+ "version": "0.19.12",
110
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
111
+ "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
112
+ "cpu": [
113
+ "x64"
114
+ ],
115
+ "optional": true,
116
+ "os": [
117
+ "darwin"
118
+ ],
119
+ "engines": {
120
+ "node": ">=12"
121
+ }
122
+ },
123
+ "node_modules/@esbuild/freebsd-arm64": {
124
+ "version": "0.19.12",
125
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
126
+ "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
127
+ "cpu": [
128
+ "arm64"
129
+ ],
130
+ "optional": true,
131
+ "os": [
132
+ "freebsd"
133
+ ],
134
+ "engines": {
135
+ "node": ">=12"
136
+ }
137
+ },
138
+ "node_modules/@esbuild/freebsd-x64": {
139
+ "version": "0.19.12",
140
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
141
+ "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
142
+ "cpu": [
143
+ "x64"
144
+ ],
145
+ "optional": true,
146
+ "os": [
147
+ "freebsd"
148
+ ],
149
+ "engines": {
150
+ "node": ">=12"
151
+ }
152
+ },
153
+ "node_modules/@esbuild/linux-arm": {
154
+ "version": "0.19.12",
155
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
156
+ "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
157
+ "cpu": [
158
+ "arm"
159
+ ],
160
+ "optional": true,
161
+ "os": [
162
+ "linux"
163
+ ],
164
+ "engines": {
165
+ "node": ">=12"
166
+ }
167
+ },
168
+ "node_modules/@esbuild/linux-arm64": {
169
+ "version": "0.19.12",
170
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
171
+ "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
172
+ "cpu": [
173
+ "arm64"
174
+ ],
175
+ "optional": true,
176
+ "os": [
177
+ "linux"
178
+ ],
179
+ "engines": {
180
+ "node": ">=12"
181
+ }
182
+ },
183
+ "node_modules/@esbuild/linux-ia32": {
184
+ "version": "0.19.12",
185
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
186
+ "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
187
+ "cpu": [
188
+ "ia32"
189
+ ],
190
+ "optional": true,
191
+ "os": [
192
+ "linux"
193
+ ],
194
+ "engines": {
195
+ "node": ">=12"
196
+ }
197
+ },
198
+ "node_modules/@esbuild/linux-loong64": {
199
+ "version": "0.19.12",
200
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
201
+ "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
202
+ "cpu": [
203
+ "loong64"
204
+ ],
205
+ "optional": true,
206
+ "os": [
207
+ "linux"
208
+ ],
209
+ "engines": {
210
+ "node": ">=12"
211
+ }
212
+ },
213
+ "node_modules/@esbuild/linux-mips64el": {
214
+ "version": "0.19.12",
215
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
216
+ "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
217
+ "cpu": [
218
+ "mips64el"
219
+ ],
220
+ "optional": true,
221
+ "os": [
222
+ "linux"
223
+ ],
224
+ "engines": {
225
+ "node": ">=12"
226
+ }
227
+ },
228
+ "node_modules/@esbuild/linux-ppc64": {
229
+ "version": "0.19.12",
230
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
231
+ "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
232
+ "cpu": [
233
+ "ppc64"
234
+ ],
235
+ "optional": true,
236
+ "os": [
237
+ "linux"
238
+ ],
239
+ "engines": {
240
+ "node": ">=12"
241
+ }
242
+ },
243
+ "node_modules/@esbuild/linux-riscv64": {
244
+ "version": "0.19.12",
245
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
246
+ "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
247
+ "cpu": [
248
+ "riscv64"
249
+ ],
250
+ "optional": true,
251
+ "os": [
252
+ "linux"
253
+ ],
254
+ "engines": {
255
+ "node": ">=12"
256
+ }
257
+ },
258
+ "node_modules/@esbuild/linux-s390x": {
259
+ "version": "0.19.12",
260
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
261
+ "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
262
+ "cpu": [
263
+ "s390x"
264
+ ],
265
+ "optional": true,
266
+ "os": [
267
+ "linux"
268
+ ],
269
+ "engines": {
270
+ "node": ">=12"
271
+ }
272
+ },
273
+ "node_modules/@esbuild/linux-x64": {
274
+ "version": "0.19.12",
275
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
276
+ "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==",
277
+ "cpu": [
278
+ "x64"
279
+ ],
280
+ "optional": true,
281
+ "os": [
282
+ "linux"
283
+ ],
284
+ "engines": {
285
+ "node": ">=12"
286
+ }
287
+ },
288
+ "node_modules/@esbuild/netbsd-x64": {
289
+ "version": "0.19.12",
290
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
291
+ "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
292
+ "cpu": [
293
+ "x64"
294
+ ],
295
+ "optional": true,
296
+ "os": [
297
+ "netbsd"
298
+ ],
299
+ "engines": {
300
+ "node": ">=12"
301
+ }
302
+ },
303
+ "node_modules/@esbuild/openbsd-x64": {
304
+ "version": "0.19.12",
305
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
306
+ "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
307
+ "cpu": [
308
+ "x64"
309
+ ],
310
+ "optional": true,
311
+ "os": [
312
+ "openbsd"
313
+ ],
314
+ "engines": {
315
+ "node": ">=12"
316
+ }
317
+ },
318
+ "node_modules/@esbuild/sunos-x64": {
319
+ "version": "0.19.12",
320
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
321
+ "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
322
+ "cpu": [
323
+ "x64"
324
+ ],
325
+ "optional": true,
326
+ "os": [
327
+ "sunos"
328
+ ],
329
+ "engines": {
330
+ "node": ">=12"
331
+ }
332
+ },
333
+ "node_modules/@esbuild/win32-arm64": {
334
+ "version": "0.19.12",
335
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
336
+ "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
337
+ "cpu": [
338
+ "arm64"
339
+ ],
340
+ "optional": true,
341
+ "os": [
342
+ "win32"
343
+ ],
344
+ "engines": {
345
+ "node": ">=12"
346
+ }
347
+ },
348
+ "node_modules/@esbuild/win32-ia32": {
349
+ "version": "0.19.12",
350
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
351
+ "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
352
+ "cpu": [
353
+ "ia32"
354
+ ],
355
+ "optional": true,
356
+ "os": [
357
+ "win32"
358
+ ],
359
+ "engines": {
360
+ "node": ">=12"
361
+ }
362
+ },
363
+ "node_modules/@esbuild/win32-x64": {
364
+ "version": "0.19.12",
365
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
366
+ "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
367
+ "cpu": [
368
+ "x64"
369
+ ],
370
+ "optional": true,
371
+ "os": [
372
+ "win32"
373
+ ],
374
+ "engines": {
375
+ "node": ">=12"
376
+ }
377
+ },
378
+ "node_modules/@formatjs/ecma402-abstract": {
379
+ "version": "1.11.4",
380
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
381
+ "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
382
+ "dependencies": {
383
+ "@formatjs/intl-localematcher": "0.2.25",
384
+ "tslib": "^2.1.0"
385
+ }
386
+ },
387
+ "node_modules/@formatjs/fast-memoize": {
388
+ "version": "1.2.1",
389
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
390
+ "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
391
+ "dependencies": {
392
+ "tslib": "^2.1.0"
393
+ }
394
+ },
395
+ "node_modules/@formatjs/icu-messageformat-parser": {
396
+ "version": "2.1.0",
397
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
398
+ "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
399
+ "dependencies": {
400
+ "@formatjs/ecma402-abstract": "1.11.4",
401
+ "@formatjs/icu-skeleton-parser": "1.3.6",
402
+ "tslib": "^2.1.0"
403
+ }
404
+ },
405
+ "node_modules/@formatjs/icu-skeleton-parser": {
406
+ "version": "1.3.6",
407
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
408
+ "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
409
+ "dependencies": {
410
+ "@formatjs/ecma402-abstract": "1.11.4",
411
+ "tslib": "^2.1.0"
412
+ }
413
+ },
414
+ "node_modules/@formatjs/intl-localematcher": {
415
+ "version": "0.2.25",
416
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
417
+ "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
418
+ "dependencies": {
419
+ "tslib": "^2.1.0"
420
+ }
421
+ },
422
+ "node_modules/@gradio/atoms": {
423
+ "version": "0.6.1",
424
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/atoms/-/atoms-0.6.1.tgz",
425
+ "integrity": "sha512-u7+cleKA0Et6AhEq5xTiaGIAYPR2He7/JSYcM3Sg+vkFOXhbJTPUnHLub+y9HiseheEmnZDGddFBr+RL5Jaxbg==",
426
+ "dependencies": {
427
+ "@gradio/icons": "^0.3.4",
428
+ "@gradio/utils": "^0.3.0"
429
+ }
430
+ },
431
+ "node_modules/@gradio/column": {
432
+ "version": "0.1.0",
433
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/column/-/column-0.1.0.tgz",
434
+ "integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
435
+ },
436
+ "node_modules/@gradio/icons": {
437
+ "version": "0.3.4",
438
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/icons/-/icons-0.3.4.tgz",
439
+ "integrity": "sha512-rtH7u3OiYy9UuO1bnebXkTXgc+D62H6BILrMtM4EfsKGgQQICD0n7NPvbPtS0zpi/fz0ppCdlfFIKKIOeVaeFg=="
440
+ },
441
+ "node_modules/@gradio/statustracker": {
442
+ "version": "0.4.10",
443
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/statustracker/-/statustracker-0.4.10.tgz",
444
+ "integrity": "sha512-1uM30C6L/E26czWZE+a8w1Y5g4FuVkfR59ZxhfL6KfWyERJmhlA8iFWrCCrS4uPZ6wFDXDsY6Im8jqL15uqPzg==",
445
+ "dependencies": {
446
+ "@gradio/atoms": "^0.6.1",
447
+ "@gradio/column": "^0.1.0",
448
+ "@gradio/icons": "^0.3.4",
449
+ "@gradio/utils": "^0.3.0"
450
+ }
451
+ },
452
+ "node_modules/@gradio/theme": {
453
+ "version": "0.2.0",
454
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/theme/-/theme-0.2.0.tgz",
455
+ "integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
456
+ },
457
+ "node_modules/@gradio/utils": {
458
+ "version": "0.3.0",
459
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@gradio/utils/-/utils-0.3.0.tgz",
460
+ "integrity": "sha512-VxP0h7UoWazkdSB875ChvTXWamBwMguuRc+8OyQFZjdj14lcqLEQuj54es3FDBpXOp5GMLFh48Q5FLLjYxMgSg==",
461
+ "dependencies": {
462
+ "@gradio/theme": "^0.2.0",
463
+ "svelte-i18n": "^3.6.0"
464
+ }
465
+ },
466
+ "node_modules/@jridgewell/gen-mapping": {
467
+ "version": "0.3.5",
468
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
469
+ "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
470
+ "peer": true,
471
+ "dependencies": {
472
+ "@jridgewell/set-array": "^1.2.1",
473
+ "@jridgewell/sourcemap-codec": "^1.4.10",
474
+ "@jridgewell/trace-mapping": "^0.3.24"
475
+ },
476
+ "engines": {
477
+ "node": ">=6.0.0"
478
+ }
479
+ },
480
+ "node_modules/@jridgewell/resolve-uri": {
481
+ "version": "3.1.2",
482
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
483
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
484
+ "peer": true,
485
+ "engines": {
486
+ "node": ">=6.0.0"
487
+ }
488
+ },
489
+ "node_modules/@jridgewell/set-array": {
490
+ "version": "1.2.1",
491
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/set-array/-/set-array-1.2.1.tgz",
492
+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
493
+ "peer": true,
494
+ "engines": {
495
+ "node": ">=6.0.0"
496
+ }
497
+ },
498
+ "node_modules/@jridgewell/sourcemap-codec": {
499
+ "version": "1.4.15",
500
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
501
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
502
+ "peer": true
503
+ },
504
+ "node_modules/@jridgewell/trace-mapping": {
505
+ "version": "0.3.25",
506
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
507
+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
508
+ "peer": true,
509
+ "dependencies": {
510
+ "@jridgewell/resolve-uri": "^3.1.0",
511
+ "@jridgewell/sourcemap-codec": "^1.4.14"
512
+ }
513
+ },
514
+ "node_modules/@types/estree": {
515
+ "version": "1.0.5",
516
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@types/estree/-/estree-1.0.5.tgz",
517
+ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
518
+ "peer": true
519
+ },
520
+ "node_modules/@xterm/xterm": {
521
+ "version": "5.5.0",
522
+ "resolved": "https://mirrors.cloud.tencent.com/npm/@xterm/xterm/-/xterm-5.5.0.tgz",
523
+ "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A=="
524
+ },
525
+ "node_modules/acorn": {
526
+ "version": "8.11.3",
527
+ "resolved": "https://mirrors.cloud.tencent.com/npm/acorn/-/acorn-8.11.3.tgz",
528
+ "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
529
+ "peer": true,
530
+ "bin": {
531
+ "acorn": "bin/acorn"
532
+ },
533
+ "engines": {
534
+ "node": ">=0.4.0"
535
+ }
536
+ },
537
+ "node_modules/aria-query": {
538
+ "version": "5.3.0",
539
+ "resolved": "https://mirrors.cloud.tencent.com/npm/aria-query/-/aria-query-5.3.0.tgz",
540
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
541
+ "peer": true,
542
+ "dependencies": {
543
+ "dequal": "^2.0.3"
544
+ }
545
+ },
546
+ "node_modules/axobject-query": {
547
+ "version": "4.0.0",
548
+ "resolved": "https://mirrors.cloud.tencent.com/npm/axobject-query/-/axobject-query-4.0.0.tgz",
549
+ "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==",
550
+ "peer": true,
551
+ "dependencies": {
552
+ "dequal": "^2.0.3"
553
+ }
554
+ },
555
+ "node_modules/cli-color": {
556
+ "version": "2.0.4",
557
+ "resolved": "https://mirrors.cloud.tencent.com/npm/cli-color/-/cli-color-2.0.4.tgz",
558
+ "integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==",
559
+ "dependencies": {
560
+ "d": "^1.0.1",
561
+ "es5-ext": "^0.10.64",
562
+ "es6-iterator": "^2.0.3",
563
+ "memoizee": "^0.4.15",
564
+ "timers-ext": "^0.1.7"
565
+ },
566
+ "engines": {
567
+ "node": ">=0.10"
568
+ }
569
+ },
570
+ "node_modules/code-red": {
571
+ "version": "1.0.4",
572
+ "resolved": "https://mirrors.cloud.tencent.com/npm/code-red/-/code-red-1.0.4.tgz",
573
+ "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
574
+ "peer": true,
575
+ "dependencies": {
576
+ "@jridgewell/sourcemap-codec": "^1.4.15",
577
+ "@types/estree": "^1.0.1",
578
+ "acorn": "^8.10.0",
579
+ "estree-walker": "^3.0.3",
580
+ "periscopic": "^3.1.0"
581
+ }
582
+ },
583
+ "node_modules/css-tree": {
584
+ "version": "2.3.1",
585
+ "resolved": "https://mirrors.cloud.tencent.com/npm/css-tree/-/css-tree-2.3.1.tgz",
586
+ "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
587
+ "peer": true,
588
+ "dependencies": {
589
+ "mdn-data": "2.0.30",
590
+ "source-map-js": "^1.0.1"
591
+ },
592
+ "engines": {
593
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
594
+ }
595
+ },
596
+ "node_modules/d": {
597
+ "version": "1.0.2",
598
+ "resolved": "https://mirrors.cloud.tencent.com/npm/d/-/d-1.0.2.tgz",
599
+ "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
600
+ "dependencies": {
601
+ "es5-ext": "^0.10.64",
602
+ "type": "^2.7.2"
603
+ },
604
+ "engines": {
605
+ "node": ">=0.12"
606
+ }
607
+ },
608
+ "node_modules/deepmerge": {
609
+ "version": "4.3.1",
610
+ "resolved": "https://mirrors.cloud.tencent.com/npm/deepmerge/-/deepmerge-4.3.1.tgz",
611
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
612
+ "engines": {
613
+ "node": ">=0.10.0"
614
+ }
615
+ },
616
+ "node_modules/dequal": {
617
+ "version": "2.0.3",
618
+ "resolved": "https://mirrors.cloud.tencent.com/npm/dequal/-/dequal-2.0.3.tgz",
619
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
620
+ "peer": true,
621
+ "engines": {
622
+ "node": ">=6"
623
+ }
624
+ },
625
+ "node_modules/es5-ext": {
626
+ "version": "0.10.64",
627
+ "resolved": "https://mirrors.cloud.tencent.com/npm/es5-ext/-/es5-ext-0.10.64.tgz",
628
+ "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
629
+ "hasInstallScript": true,
630
+ "dependencies": {
631
+ "es6-iterator": "^2.0.3",
632
+ "es6-symbol": "^3.1.3",
633
+ "esniff": "^2.0.1",
634
+ "next-tick": "^1.1.0"
635
+ },
636
+ "engines": {
637
+ "node": ">=0.10"
638
+ }
639
+ },
640
+ "node_modules/es6-iterator": {
641
+ "version": "2.0.3",
642
+ "resolved": "https://mirrors.cloud.tencent.com/npm/es6-iterator/-/es6-iterator-2.0.3.tgz",
643
+ "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
644
+ "dependencies": {
645
+ "d": "1",
646
+ "es5-ext": "^0.10.35",
647
+ "es6-symbol": "^3.1.1"
648
+ }
649
+ },
650
+ "node_modules/es6-symbol": {
651
+ "version": "3.1.4",
652
+ "resolved": "https://mirrors.cloud.tencent.com/npm/es6-symbol/-/es6-symbol-3.1.4.tgz",
653
+ "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
654
+ "dependencies": {
655
+ "d": "^1.0.2",
656
+ "ext": "^1.7.0"
657
+ },
658
+ "engines": {
659
+ "node": ">=0.12"
660
+ }
661
+ },
662
+ "node_modules/es6-weak-map": {
663
+ "version": "2.0.3",
664
+ "resolved": "https://mirrors.cloud.tencent.com/npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
665
+ "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
666
+ "dependencies": {
667
+ "d": "1",
668
+ "es5-ext": "^0.10.46",
669
+ "es6-iterator": "^2.0.3",
670
+ "es6-symbol": "^3.1.1"
671
+ }
672
+ },
673
+ "node_modules/esbuild": {
674
+ "version": "0.19.12",
675
+ "resolved": "https://mirrors.cloud.tencent.com/npm/esbuild/-/esbuild-0.19.12.tgz",
676
+ "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==",
677
+ "hasInstallScript": true,
678
+ "bin": {
679
+ "esbuild": "bin/esbuild"
680
+ },
681
+ "engines": {
682
+ "node": ">=12"
683
+ },
684
+ "optionalDependencies": {
685
+ "@esbuild/aix-ppc64": "0.19.12",
686
+ "@esbuild/android-arm": "0.19.12",
687
+ "@esbuild/android-arm64": "0.19.12",
688
+ "@esbuild/android-x64": "0.19.12",
689
+ "@esbuild/darwin-arm64": "0.19.12",
690
+ "@esbuild/darwin-x64": "0.19.12",
691
+ "@esbuild/freebsd-arm64": "0.19.12",
692
+ "@esbuild/freebsd-x64": "0.19.12",
693
+ "@esbuild/linux-arm": "0.19.12",
694
+ "@esbuild/linux-arm64": "0.19.12",
695
+ "@esbuild/linux-ia32": "0.19.12",
696
+ "@esbuild/linux-loong64": "0.19.12",
697
+ "@esbuild/linux-mips64el": "0.19.12",
698
+ "@esbuild/linux-ppc64": "0.19.12",
699
+ "@esbuild/linux-riscv64": "0.19.12",
700
+ "@esbuild/linux-s390x": "0.19.12",
701
+ "@esbuild/linux-x64": "0.19.12",
702
+ "@esbuild/netbsd-x64": "0.19.12",
703
+ "@esbuild/openbsd-x64": "0.19.12",
704
+ "@esbuild/sunos-x64": "0.19.12",
705
+ "@esbuild/win32-arm64": "0.19.12",
706
+ "@esbuild/win32-ia32": "0.19.12",
707
+ "@esbuild/win32-x64": "0.19.12"
708
+ }
709
+ },
710
+ "node_modules/esniff": {
711
+ "version": "2.0.1",
712
+ "resolved": "https://mirrors.cloud.tencent.com/npm/esniff/-/esniff-2.0.1.tgz",
713
+ "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
714
+ "dependencies": {
715
+ "d": "^1.0.1",
716
+ "es5-ext": "^0.10.62",
717
+ "event-emitter": "^0.3.5",
718
+ "type": "^2.7.2"
719
+ },
720
+ "engines": {
721
+ "node": ">=0.10"
722
+ }
723
+ },
724
+ "node_modules/estree-walker": {
725
+ "version": "3.0.3",
726
+ "resolved": "https://mirrors.cloud.tencent.com/npm/estree-walker/-/estree-walker-3.0.3.tgz",
727
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
728
+ "peer": true,
729
+ "dependencies": {
730
+ "@types/estree": "^1.0.0"
731
+ }
732
+ },
733
+ "node_modules/event-emitter": {
734
+ "version": "0.3.5",
735
+ "resolved": "https://mirrors.cloud.tencent.com/npm/event-emitter/-/event-emitter-0.3.5.tgz",
736
+ "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
737
+ "dependencies": {
738
+ "d": "1",
739
+ "es5-ext": "~0.10.14"
740
+ }
741
+ },
742
+ "node_modules/ext": {
743
+ "version": "1.7.0",
744
+ "resolved": "https://mirrors.cloud.tencent.com/npm/ext/-/ext-1.7.0.tgz",
745
+ "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
746
+ "dependencies": {
747
+ "type": "^2.7.2"
748
+ }
749
+ },
750
+ "node_modules/globalyzer": {
751
+ "version": "0.1.0",
752
+ "resolved": "https://mirrors.cloud.tencent.com/npm/globalyzer/-/globalyzer-0.1.0.tgz",
753
+ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
754
+ },
755
+ "node_modules/globrex": {
756
+ "version": "0.1.2",
757
+ "resolved": "https://mirrors.cloud.tencent.com/npm/globrex/-/globrex-0.1.2.tgz",
758
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
759
+ },
760
+ "node_modules/intl-messageformat": {
761
+ "version": "9.13.0",
762
+ "resolved": "https://mirrors.cloud.tencent.com/npm/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
763
+ "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
764
+ "dependencies": {
765
+ "@formatjs/ecma402-abstract": "1.11.4",
766
+ "@formatjs/fast-memoize": "1.2.1",
767
+ "@formatjs/icu-messageformat-parser": "2.1.0",
768
+ "tslib": "^2.1.0"
769
+ }
770
+ },
771
+ "node_modules/is-promise": {
772
+ "version": "2.2.2",
773
+ "resolved": "https://mirrors.cloud.tencent.com/npm/is-promise/-/is-promise-2.2.2.tgz",
774
+ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
775
+ },
776
+ "node_modules/is-reference": {
777
+ "version": "3.0.2",
778
+ "resolved": "https://mirrors.cloud.tencent.com/npm/is-reference/-/is-reference-3.0.2.tgz",
779
+ "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
780
+ "peer": true,
781
+ "dependencies": {
782
+ "@types/estree": "*"
783
+ }
784
+ },
785
+ "node_modules/locate-character": {
786
+ "version": "3.0.0",
787
+ "resolved": "https://mirrors.cloud.tencent.com/npm/locate-character/-/locate-character-3.0.0.tgz",
788
+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
789
+ "peer": true
790
+ },
791
+ "node_modules/lru-queue": {
792
+ "version": "0.1.0",
793
+ "resolved": "https://mirrors.cloud.tencent.com/npm/lru-queue/-/lru-queue-0.1.0.tgz",
794
+ "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
795
+ "dependencies": {
796
+ "es5-ext": "~0.10.2"
797
+ }
798
+ },
799
+ "node_modules/magic-string": {
800
+ "version": "0.30.9",
801
+ "resolved": "https://mirrors.cloud.tencent.com/npm/magic-string/-/magic-string-0.30.9.tgz",
802
+ "integrity": "sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==",
803
+ "peer": true,
804
+ "dependencies": {
805
+ "@jridgewell/sourcemap-codec": "^1.4.15"
806
+ },
807
+ "engines": {
808
+ "node": ">=12"
809
+ }
810
+ },
811
+ "node_modules/mdn-data": {
812
+ "version": "2.0.30",
813
+ "resolved": "https://mirrors.cloud.tencent.com/npm/mdn-data/-/mdn-data-2.0.30.tgz",
814
+ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
815
+ "peer": true
816
+ },
817
+ "node_modules/memoizee": {
818
+ "version": "0.4.15",
819
+ "resolved": "https://mirrors.cloud.tencent.com/npm/memoizee/-/memoizee-0.4.15.tgz",
820
+ "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
821
+ "dependencies": {
822
+ "d": "^1.0.1",
823
+ "es5-ext": "^0.10.53",
824
+ "es6-weak-map": "^2.0.3",
825
+ "event-emitter": "^0.3.5",
826
+ "is-promise": "^2.2.2",
827
+ "lru-queue": "^0.1.0",
828
+ "next-tick": "^1.1.0",
829
+ "timers-ext": "^0.1.7"
830
+ }
831
+ },
832
+ "node_modules/mri": {
833
+ "version": "1.2.0",
834
+ "resolved": "https://mirrors.cloud.tencent.com/npm/mri/-/mri-1.2.0.tgz",
835
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
836
+ "engines": {
837
+ "node": ">=4"
838
+ }
839
+ },
840
+ "node_modules/next-tick": {
841
+ "version": "1.1.0",
842
+ "resolved": "https://mirrors.cloud.tencent.com/npm/next-tick/-/next-tick-1.1.0.tgz",
843
+ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
844
+ },
845
+ "node_modules/periscopic": {
846
+ "version": "3.1.0",
847
+ "resolved": "https://mirrors.cloud.tencent.com/npm/periscopic/-/periscopic-3.1.0.tgz",
848
+ "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
849
+ "peer": true,
850
+ "dependencies": {
851
+ "@types/estree": "^1.0.0",
852
+ "estree-walker": "^3.0.0",
853
+ "is-reference": "^3.0.0"
854
+ }
855
+ },
856
+ "node_modules/sade": {
857
+ "version": "1.8.1",
858
+ "resolved": "https://mirrors.cloud.tencent.com/npm/sade/-/sade-1.8.1.tgz",
859
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
860
+ "dependencies": {
861
+ "mri": "^1.1.0"
862
+ },
863
+ "engines": {
864
+ "node": ">=6"
865
+ }
866
+ },
867
+ "node_modules/source-map-js": {
868
+ "version": "1.2.0",
869
+ "resolved": "https://mirrors.cloud.tencent.com/npm/source-map-js/-/source-map-js-1.2.0.tgz",
870
+ "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
871
+ "peer": true,
872
+ "engines": {
873
+ "node": ">=0.10.0"
874
+ }
875
+ },
876
+ "node_modules/svelte": {
877
+ "version": "4.2.12",
878
+ "resolved": "https://mirrors.cloud.tencent.com/npm/svelte/-/svelte-4.2.12.tgz",
879
+ "integrity": "sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==",
880
+ "peer": true,
881
+ "dependencies": {
882
+ "@ampproject/remapping": "^2.2.1",
883
+ "@jridgewell/sourcemap-codec": "^1.4.15",
884
+ "@jridgewell/trace-mapping": "^0.3.18",
885
+ "@types/estree": "^1.0.1",
886
+ "acorn": "^8.9.0",
887
+ "aria-query": "^5.3.0",
888
+ "axobject-query": "^4.0.0",
889
+ "code-red": "^1.0.3",
890
+ "css-tree": "^2.3.1",
891
+ "estree-walker": "^3.0.3",
892
+ "is-reference": "^3.0.1",
893
+ "locate-character": "^3.0.0",
894
+ "magic-string": "^0.30.4",
895
+ "periscopic": "^3.1.0"
896
+ },
897
+ "engines": {
898
+ "node": ">=16"
899
+ }
900
+ },
901
+ "node_modules/svelte-i18n": {
902
+ "version": "3.7.4",
903
+ "resolved": "https://mirrors.cloud.tencent.com/npm/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
904
+ "integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
905
+ "dependencies": {
906
+ "cli-color": "^2.0.3",
907
+ "deepmerge": "^4.2.2",
908
+ "esbuild": "^0.19.2",
909
+ "estree-walker": "^2",
910
+ "intl-messageformat": "^9.13.0",
911
+ "sade": "^1.8.1",
912
+ "tiny-glob": "^0.2.9"
913
+ },
914
+ "bin": {
915
+ "svelte-i18n": "dist/cli.js"
916
+ },
917
+ "engines": {
918
+ "node": ">= 16"
919
+ },
920
+ "peerDependencies": {
921
+ "svelte": "^3 || ^4"
922
+ }
923
+ },
924
+ "node_modules/svelte-i18n/node_modules/estree-walker": {
925
+ "version": "2.0.2",
926
+ "resolved": "https://mirrors.cloud.tencent.com/npm/estree-walker/-/estree-walker-2.0.2.tgz",
927
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
928
+ },
929
+ "node_modules/timers-ext": {
930
+ "version": "0.1.7",
931
+ "resolved": "https://mirrors.cloud.tencent.com/npm/timers-ext/-/timers-ext-0.1.7.tgz",
932
+ "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
933
+ "dependencies": {
934
+ "es5-ext": "~0.10.46",
935
+ "next-tick": "1"
936
+ }
937
+ },
938
+ "node_modules/tiny-glob": {
939
+ "version": "0.2.9",
940
+ "resolved": "https://mirrors.cloud.tencent.com/npm/tiny-glob/-/tiny-glob-0.2.9.tgz",
941
+ "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
942
+ "dependencies": {
943
+ "globalyzer": "0.1.0",
944
+ "globrex": "^0.1.2"
945
+ }
946
+ },
947
+ "node_modules/tslib": {
948
+ "version": "2.6.2",
949
+ "resolved": "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.6.2.tgz",
950
+ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
951
+ },
952
+ "node_modules/type": {
953
+ "version": "2.7.2",
954
+ "resolved": "https://mirrors.cloud.tencent.com/npm/type/-/type-2.7.2.tgz",
955
+ "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
956
+ },
957
+ "node_modules/xterm": {
958
+ "version": "5.3.0",
959
+ "resolved": "https://mirrors.cloud.tencent.com/npm/xterm/-/xterm-5.3.0.tgz",
960
+ "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==",
961
+ "peer": true
962
+ },
963
+ "node_modules/xterm-addon-fit": {
964
+ "version": "0.8.0",
965
+ "resolved": "https://mirrors.cloud.tencent.com/npm/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz",
966
+ "integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==",
967
+ "peerDependencies": {
968
+ "xterm": "^5.0.0"
969
+ }
970
+ }
971
+ }
972
+ }
src/frontend/package.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gradio_log",
3
+ "version": "0.1.13",
4
+ "description": "Gradio UI packages",
5
+ "type": "module",
6
+ "author": "",
7
+ "license": "ISC",
8
+ "private": false,
9
+ "main_changeset": true,
10
+ "exports": {
11
+ ".": "./Index.svelte",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "dependencies": {
15
+ "@gradio/atoms": "0.6.1",
16
+ "@gradio/icons": "0.3.4",
17
+ "@gradio/statustracker": "0.4.10",
18
+ "@gradio/utils": "0.3.0",
19
+ "@xterm/xterm": "^5.5.0",
20
+ "xterm-addon-fit": "^0.8.0"
21
+ }
22
+ }
src/pyproject.toml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = [
3
+ "hatchling",
4
+ "hatch-requirements-txt",
5
+ "hatch-fancy-pypi-readme>=22.5.0",
6
+ ]
7
+ build-backend = "hatchling.build"
8
+
9
+ [project]
10
+ name = "gradio_log"
11
+ version = "0.0.1"
12
+ description = "Python library for easily interacting with trained machine learning models"
13
+ readme = "README.md"
14
+ license = "Apache-2.0"
15
+ requires-python = ">=3.8"
16
+ authors = [{ name = "YOUR NAME", email = "YOUREMAIL@domain.com" }]
17
+ keywords = [
18
+ "gradio-custom-component",
19
+ "gradio-template-SimpleTextbox"
20
+ ]
21
+ # Add dependencies here
22
+ dependencies = ["gradio>=4.0,<5.0"]
23
+ classifiers = [
24
+ 'Development Status :: 3 - Alpha',
25
+ 'License :: OSI Approved :: Apache Software License',
26
+ 'Operating System :: OS Independent',
27
+ 'Programming Language :: Python :: 3',
28
+ 'Programming Language :: Python :: 3 :: Only',
29
+ 'Programming Language :: Python :: 3.8',
30
+ 'Programming Language :: Python :: 3.9',
31
+ 'Programming Language :: Python :: 3.10',
32
+ 'Programming Language :: Python :: 3.11',
33
+ 'Topic :: Scientific/Engineering',
34
+ 'Topic :: Scientific/Engineering :: Artificial Intelligence',
35
+ 'Topic :: Scientific/Engineering :: Visualization',
36
+ ]
37
+
38
+ [project.optional-dependencies]
39
+ dev = ["build", "twine"]
40
+
41
+ [tool.hatch.build]
42
+ artifacts = ["/backend/gradio_log/templates", "*.pyi", "backend/gradio_log/templates", "backend/gradio_log/templates"]
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["/backend/gradio_log"]