Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -702,11 +702,12 @@ def initial_load(model_id: str, system_prompt: str, user_prompt: str, s: Session
|
|
| 702 |
# ββ Gradio UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 703 |
CSS = """
|
| 704 |
/* ββ Global tightening ββ */
|
| 705 |
-
.gradio-container { max-width: 100% !important; padding:
|
| 706 |
-
.gradio-container .main { padding: 0 !important; gap:
|
| 707 |
-
.gradio-container .gap, .gradio-container .form { gap:
|
| 708 |
-
.gradio-container .block { padding:
|
| 709 |
.gradio-container .gr-block { padding: 0 !important; }
|
|
|
|
| 710 |
|
| 711 |
/* ββ Header: kill the giant title margins ββ */
|
| 712 |
#hdr h1 { font-size: 18px !important; margin: 0 !important; padding: 0 !important; line-height: 1.2 !important; }
|
|
@@ -799,8 +800,13 @@ def build_ui():
|
|
| 799 |
show_label=True)
|
| 800 |
system_prompt = gr.Textbox(label="System", value="",
|
| 801 |
lines=1, max_lines=3, scale=4, container=True)
|
| 802 |
-
user_prompt = gr.Textbox(
|
| 803 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 804 |
load_btn = gr.Button("Load", variant="primary", scale=1, min_width=80)
|
| 805 |
|
| 806 |
muted_html = gr.HTML(elem_id="muted-row")
|
|
@@ -810,10 +816,16 @@ def build_ui():
|
|
| 810 |
"<div class='pane-body'><i>Click <b>Load</b> to begin.</i></div></div>")
|
| 811 |
|
| 812 |
# ββ Command bar: directly under Context (eye scans context β types command) ββ
|
| 813 |
-
gr.Markdown(HELP, elem_id="help")
|
| 814 |
with gr.Row(elem_id="cmdbar"):
|
| 815 |
-
cmd = gr.Textbox(
|
| 816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 817 |
run_btn = gr.Button("Run", scale=1, variant="primary", min_width=70)
|
| 818 |
|
| 819 |
# ββ Branches + Head Map: side by side ββ
|
|
|
|
| 702 |
# ββ Gradio UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 703 |
CSS = """
|
| 704 |
/* ββ Global tightening ββ */
|
| 705 |
+
.gradio-container { max-width: 100% !important; padding: 6px 10px !important; }
|
| 706 |
+
.gradio-container .main { padding: 0 !important; gap: 4px !important; }
|
| 707 |
+
.gradio-container .gap, .gradio-container .form { gap: 4px !important; }
|
| 708 |
+
.gradio-container .block { padding: 3px !important; border-radius: 4px !important; }
|
| 709 |
.gradio-container .gr-block { padding: 0 !important; }
|
| 710 |
+
.gradio-container .prose { margin: 0 !important; }
|
| 711 |
|
| 712 |
/* ββ Header: kill the giant title margins ββ */
|
| 713 |
#hdr h1 { font-size: 18px !important; margin: 0 !important; padding: 0 !important; line-height: 1.2 !important; }
|
|
|
|
| 800 |
show_label=True)
|
| 801 |
system_prompt = gr.Textbox(label="System", value="",
|
| 802 |
lines=1, max_lines=3, scale=4, container=True)
|
| 803 |
+
user_prompt = gr.Textbox(
|
| 804 |
+
label="User",
|
| 805 |
+
value=("Hi, I need something like a cake recipe but it can't include eggs, sugar, "
|
| 806 |
+
"gluten-- so no flour, actually make that no grains of any sort, as well as "
|
| 807 |
+
"liquid and solid ingredients, none of them either. Thanks!"),
|
| 808 |
+
lines=1, max_lines=3, scale=5, container=True,
|
| 809 |
+
)
|
| 810 |
load_btn = gr.Button("Load", variant="primary", scale=1, min_width=80)
|
| 811 |
|
| 812 |
muted_html = gr.HTML(elem_id="muted-row")
|
|
|
|
| 816 |
"<div class='pane-body'><i>Click <b>Load</b> to begin.</i></div></div>")
|
| 817 |
|
| 818 |
# ββ Command bar: directly under Context (eye scans context β types command) ββ
|
|
|
|
| 819 |
with gr.Row(elem_id="cmdbar"):
|
| 820 |
+
cmd = gr.Textbox(
|
| 821 |
+
label="CMD",
|
| 822 |
+
placeholder=(
|
| 823 |
+
"1-N select branch Β· 1,5 select+keep Β· i <text> inject Β· "
|
| 824 |
+
"h *|h L|h L H scan Β· top R1,R2,β¦ rank-pick Β· rew N Β· "
|
| 825 |
+
"spark <tok> [lo:hi] rank trace Β· w N Β· l N Β· mute L H Β· unmute L H|all Β· muted Β· r Β· s"
|
| 826 |
+
),
|
| 827 |
+
scale=10, autofocus=True, lines=1, max_lines=1, container=True,
|
| 828 |
+
)
|
| 829 |
run_btn = gr.Button("Run", scale=1, variant="primary", min_width=70)
|
| 830 |
|
| 831 |
# ββ Branches + Head Map: side by side ββ
|