Spaces:
Running on Zero
Running on Zero
Commit ·
b122899
1
Parent(s): 62ddcce
Fix f-string backslash syntax error in build_suggestion_chips_html
Browse files
app.py
CHANGED
|
@@ -154,11 +154,12 @@ def load_example_data(idx_str):
|
|
| 154 |
|
| 155 |
|
| 156 |
def build_suggestion_chips_html():
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
print("Building example thumbnails...")
|
|
|
|
| 154 |
|
| 155 |
|
| 156 |
def build_suggestion_chips_html():
|
| 157 |
+
chips = []
|
| 158 |
+
for s in SUGGESTIONS_CONFIG:
|
| 159 |
+
prompt_json = json.dumps(s["prompt"])
|
| 160 |
+
label = html_lib.escape(s["label"])
|
| 161 |
+
chips.append(f'<button class="suggestion-chip" onclick="window.__setPrompt({prompt_json})">{label}</button>')
|
| 162 |
+
return "".join(chips)
|
| 163 |
|
| 164 |
|
| 165 |
print("Building example thumbnails...")
|