Spaces:
Running
Running
UI hints
Browse files
app.py
CHANGED
@@ -97,6 +97,7 @@ with gr.Blocks(
|
|
97 |
meta_keys = gr.Dropdown(
|
98 |
None,
|
99 |
label = "Modify Metadata",
|
|
|
100 |
allow_custom_value = True,
|
101 |
visible = False,
|
102 |
)
|
@@ -105,6 +106,7 @@ with gr.Blocks(
|
|
105 |
meta_types = gr.Dropdown(
|
106 |
[e.name for e in GGUFValueType],
|
107 |
label = "Metadata Type",
|
|
|
108 |
type = "index",
|
109 |
visible = False,
|
110 |
)
|
@@ -112,48 +114,55 @@ with gr.Blocks(
|
|
112 |
with gr.Column():
|
113 |
btn_delete = gr.Button(
|
114 |
"Remove Key",
|
115 |
-
variant =
|
116 |
visible = False,
|
117 |
)
|
118 |
|
119 |
meta_boolean = gr.Checkbox(
|
|
|
|
|
120 |
visible = False,
|
121 |
)
|
122 |
|
123 |
with gr.Row():
|
124 |
meta_token_select = gr.Dropdown(
|
125 |
-
label =
|
126 |
-
|
|
|
127 |
allow_custom_value = True,
|
128 |
visible = False,
|
129 |
)
|
130 |
|
131 |
meta_token_type = gr.Dropdown(
|
132 |
[e.name for e in TokenType],
|
133 |
-
label =
|
134 |
-
|
|
|
135 |
visible = False,
|
136 |
)
|
137 |
|
138 |
meta_lookup = gr.Dropdown(
|
139 |
-
label =
|
140 |
-
|
|
|
141 |
allow_custom_value = True,
|
142 |
visible = False,
|
143 |
)
|
144 |
|
145 |
meta_number = gr.Number(
|
|
|
146 |
visible = False,
|
147 |
)
|
148 |
|
149 |
meta_string = gr.Textbox(
|
|
|
150 |
visible = False,
|
151 |
)
|
152 |
|
153 |
meta_array = gr.Matrix(
|
154 |
None,
|
155 |
label = "Unsupported",
|
156 |
-
row_count = (1,
|
157 |
height = "1rem",
|
158 |
interactive = False,
|
159 |
visible = False,
|
@@ -162,7 +171,7 @@ with gr.Blocks(
|
|
162 |
meta_changes = gr.HighlightedText(
|
163 |
None,
|
164 |
label = "Metadata Changes",
|
165 |
-
color_map = {
|
166 |
interactive = False,
|
167 |
visible = False,
|
168 |
)
|
@@ -404,7 +413,7 @@ with gr.Blocks(
|
|
404 |
return {
|
405 |
meta_types: gr.Dropdown(
|
406 |
value = typ,
|
407 |
-
interactive = False if
|
408 |
visible = True if key else False,
|
409 |
),
|
410 |
btn_delete: gr.Button(
|
|
|
97 |
meta_keys = gr.Dropdown(
|
98 |
None,
|
99 |
label = "Modify Metadata",
|
100 |
+
info = "Search by metadata key name",
|
101 |
allow_custom_value = True,
|
102 |
visible = False,
|
103 |
)
|
|
|
106 |
meta_types = gr.Dropdown(
|
107 |
[e.name for e in GGUFValueType],
|
108 |
label = "Metadata Type",
|
109 |
+
info = "Select data type",
|
110 |
type = "index",
|
111 |
visible = False,
|
112 |
)
|
|
|
114 |
with gr.Column():
|
115 |
btn_delete = gr.Button(
|
116 |
"Remove Key",
|
117 |
+
variant = "stop",
|
118 |
visible = False,
|
119 |
)
|
120 |
|
121 |
meta_boolean = gr.Checkbox(
|
122 |
+
label = "Boolean",
|
123 |
+
info = "Click to update value",
|
124 |
visible = False,
|
125 |
)
|
126 |
|
127 |
with gr.Row():
|
128 |
meta_token_select = gr.Dropdown(
|
129 |
+
label = "Select token",
|
130 |
+
info = "Search by token name",
|
131 |
+
type = "index",
|
132 |
allow_custom_value = True,
|
133 |
visible = False,
|
134 |
)
|
135 |
|
136 |
meta_token_type = gr.Dropdown(
|
137 |
[e.name for e in TokenType],
|
138 |
+
label = "Token type",
|
139 |
+
info = "Select token type",
|
140 |
+
type = "index",
|
141 |
visible = False,
|
142 |
)
|
143 |
|
144 |
meta_lookup = gr.Dropdown(
|
145 |
+
label = "Lookup token",
|
146 |
+
info = "Search by token name",
|
147 |
+
type = "index",
|
148 |
allow_custom_value = True,
|
149 |
visible = False,
|
150 |
)
|
151 |
|
152 |
meta_number = gr.Number(
|
153 |
+
info = "Enter to update value",
|
154 |
visible = False,
|
155 |
)
|
156 |
|
157 |
meta_string = gr.Textbox(
|
158 |
+
info = "Enter to update value (Shift+Enter for new line)",
|
159 |
visible = False,
|
160 |
)
|
161 |
|
162 |
meta_array = gr.Matrix(
|
163 |
None,
|
164 |
label = "Unsupported",
|
165 |
+
row_count = (1, "fixed"),
|
166 |
height = "1rem",
|
167 |
interactive = False,
|
168 |
visible = False,
|
|
|
171 |
meta_changes = gr.HighlightedText(
|
172 |
None,
|
173 |
label = "Metadata Changes",
|
174 |
+
color_map = {"add": "green", "rem": "red"},
|
175 |
interactive = False,
|
176 |
visible = False,
|
177 |
)
|
|
|
413 |
return {
|
414 |
meta_types: gr.Dropdown(
|
415 |
value = typ,
|
416 |
+
interactive = False if typ is not None else True,
|
417 |
visible = True if key else False,
|
418 |
),
|
419 |
btn_delete: gr.Button(
|