Commit Β·
692cbd8
1
Parent(s): 0cc54a6
CLI-style terminal UI: dark theme, monospace font, green-on-black aesthetic
Browse files
app.py
CHANGED
|
@@ -74,85 +74,128 @@ def respond(message: str, history: list[dict]) -> str:
|
|
| 74 |
|
| 75 |
|
| 76 |
CSS = """
|
|
|
|
|
|
|
| 77 |
.gradio-container {
|
| 78 |
max-width: 900px !important;
|
| 79 |
margin: auto !important;
|
| 80 |
-
background:
|
|
|
|
| 81 |
min-height: 100vh;
|
| 82 |
}
|
| 83 |
footer { display: none !important; }
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
| 88 |
margin-bottom: 20px;
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
color: white;
|
| 92 |
}
|
| 93 |
-
.
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
| 97 |
}
|
| 98 |
-
.
|
| 99 |
-
|
| 100 |
-
opacity: 0.9;
|
| 101 |
-
margin-top: 8px;
|
| 102 |
}
|
| 103 |
-
.
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
display: flex;
|
| 106 |
-
|
| 107 |
-
|
| 108 |
flex-wrap: wrap;
|
| 109 |
}
|
| 110 |
-
.
|
| 111 |
-
background:
|
| 112 |
-
|
| 113 |
-
border:
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
font-
|
| 118 |
}
|
|
|
|
|
|
|
| 119 |
.footer-bar {
|
| 120 |
text-align: center;
|
| 121 |
-
padding:
|
| 122 |
margin-top: 15px;
|
| 123 |
-
background:
|
| 124 |
-
border
|
| 125 |
-
border:
|
| 126 |
-
color: #
|
| 127 |
-
font-size: 0.
|
|
|
|
| 128 |
}
|
| 129 |
-
.footer-bar a { color: #
|
| 130 |
.footer-bar a:hover { text-decoration: underline; }
|
| 131 |
"""
|
| 132 |
|
| 133 |
HEADER = """
|
| 134 |
-
<div class="
|
| 135 |
-
<
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
<span class="
|
| 139 |
-
<span class="
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
</div>
|
| 143 |
</div>
|
| 144 |
"""
|
| 145 |
|
| 146 |
FOOTER = """
|
| 147 |
<div class="footer-bar">
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
</div>
|
| 152 |
"""
|
| 153 |
|
| 154 |
# --- Gradio UI ---
|
| 155 |
-
with gr.Blocks(css=CSS, title="Tech Advisor") as demo:
|
| 156 |
gr.HTML(HEADER)
|
| 157 |
|
| 158 |
gr.ChatInterface(
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
CSS = """
|
| 77 |
+
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
|
| 78 |
+
|
| 79 |
.gradio-container {
|
| 80 |
max-width: 900px !important;
|
| 81 |
margin: auto !important;
|
| 82 |
+
background: #0d1117 !important;
|
| 83 |
+
font-family: 'JetBrains Mono', monospace !important;
|
| 84 |
min-height: 100vh;
|
| 85 |
}
|
| 86 |
footer { display: none !important; }
|
| 87 |
+
|
| 88 |
+
.terminal-header {
|
| 89 |
+
background: #161b22;
|
| 90 |
+
border: 1px solid #30363d;
|
| 91 |
+
border-radius: 8px;
|
| 92 |
+
padding: 0;
|
| 93 |
margin-bottom: 20px;
|
| 94 |
+
overflow: hidden;
|
| 95 |
+
box-shadow: 0 8px 32px rgba(0, 255, 65, 0.1);
|
|
|
|
| 96 |
}
|
| 97 |
+
.terminal-bar {
|
| 98 |
+
background: #21262d;
|
| 99 |
+
padding: 8px 14px;
|
| 100 |
+
display: flex;
|
| 101 |
+
align-items: center;
|
| 102 |
+
gap: 8px;
|
| 103 |
+
border-bottom: 1px solid #30363d;
|
| 104 |
}
|
| 105 |
+
.terminal-dot {
|
| 106 |
+
width: 12px; height: 12px; border-radius: 50%;
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
+
.dot-red { background: #ff5f56; }
|
| 109 |
+
.dot-yellow { background: #ffbd2e; }
|
| 110 |
+
.dot-green { background: #27c93f; }
|
| 111 |
+
.terminal-title {
|
| 112 |
+
color: #8b949e;
|
| 113 |
+
font-size: 0.8em;
|
| 114 |
+
margin-left: 10px;
|
| 115 |
+
font-family: 'JetBrains Mono', monospace;
|
| 116 |
+
}
|
| 117 |
+
.terminal-body {
|
| 118 |
+
padding: 20px 24px;
|
| 119 |
+
color: #c9d1d9;
|
| 120 |
+
font-family: 'JetBrains Mono', monospace;
|
| 121 |
+
font-size: 0.9em;
|
| 122 |
+
line-height: 1.8;
|
| 123 |
+
}
|
| 124 |
+
.terminal-body .prompt { color: #27c93f; }
|
| 125 |
+
.terminal-body .cmd { color: #f0f6fc; font-weight: 700; }
|
| 126 |
+
.terminal-body .output { color: #8b949e; }
|
| 127 |
+
.terminal-body .highlight { color: #ff7b72; }
|
| 128 |
+
.terminal-body .cyan { color: #79c0ff; }
|
| 129 |
+
.terminal-body .yellow { color: #e3b341; }
|
| 130 |
+
|
| 131 |
+
.stats-row {
|
| 132 |
display: flex;
|
| 133 |
+
gap: 12px;
|
| 134 |
+
margin-top: 16px;
|
| 135 |
flex-wrap: wrap;
|
| 136 |
}
|
| 137 |
+
.stat-chip {
|
| 138 |
+
background: #21262d;
|
| 139 |
+
border: 1px solid #30363d;
|
| 140 |
+
border-radius: 6px;
|
| 141 |
+
padding: 6px 12px;
|
| 142 |
+
font-size: 0.8em;
|
| 143 |
+
color: #c9d1d9;
|
| 144 |
+
font-family: 'JetBrains Mono', monospace;
|
| 145 |
}
|
| 146 |
+
.stat-chip .val { color: #27c93f; font-weight: 700; }
|
| 147 |
+
|
| 148 |
.footer-bar {
|
| 149 |
text-align: center;
|
| 150 |
+
padding: 14px;
|
| 151 |
margin-top: 15px;
|
| 152 |
+
background: #161b22;
|
| 153 |
+
border: 1px solid #30363d;
|
| 154 |
+
border-radius: 8px;
|
| 155 |
+
color: #8b949e;
|
| 156 |
+
font-size: 0.8em;
|
| 157 |
+
font-family: 'JetBrains Mono', monospace;
|
| 158 |
}
|
| 159 |
+
.footer-bar a { color: #27c93f; text-decoration: none; }
|
| 160 |
.footer-bar a:hover { text-decoration: underline; }
|
| 161 |
"""
|
| 162 |
|
| 163 |
HEADER = """
|
| 164 |
+
<div class="terminal-header">
|
| 165 |
+
<div class="terminal-bar">
|
| 166 |
+
<span class="terminal-dot dot-red"></span>
|
| 167 |
+
<span class="terminal-dot dot-yellow"></span>
|
| 168 |
+
<span class="terminal-dot dot-green"></span>
|
| 169 |
+
<span class="terminal-title">local-tech-advisor v1.0 β bash</span>
|
| 170 |
+
</div>
|
| 171 |
+
<div class="terminal-body">
|
| 172 |
+
<span class="prompt">$</span> <span class="cmd">./local-tech-advisor --start</span><br>
|
| 173 |
+
<span class="output">[INFO] Loading model: <span class="cyan">nemotron-nano-4b</span> (fine-tuned)</span><br>
|
| 174 |
+
<span class="output">[INFO] Training cost: <span class="highlight">$2.03</span> | Training time: <span class="highlight">35 min</span></span><br>
|
| 175 |
+
<span class="output">[INFO] API calls needed: <span class="yellow">none. ever.</span></span><br>
|
| 176 |
+
<span class="output">[INFO] Status: <span class="cyan">ready</span> β ask me anything about AWS DevOps Agent</span><br>
|
| 177 |
+
<span class="prompt">$</span> <span class="cmd blink">_</span>
|
| 178 |
+
<div class="stats-row">
|
| 179 |
+
<span class="stat-chip"><span class="val">4B</span> params</span>
|
| 180 |
+
<span class="stat-chip"><span class="val">66</span> docs</span>
|
| 181 |
+
<span class="stat-chip"><span class="val">1,230</span> Q&A pairs</span>
|
| 182 |
+
<span class="stat-chip"><span class="val">$0</span> per query</span>
|
| 183 |
+
<span class="stat-chip"><span class="val">0</span> APIs called</span>
|
| 184 |
+
</div>
|
| 185 |
</div>
|
| 186 |
</div>
|
| 187 |
"""
|
| 188 |
|
| 189 |
FOOTER = """
|
| 190 |
<div class="footer-bar">
|
| 191 |
+
<span class="prompt">$</span> echo "Built for Build Small Hackathon" |
|
| 192 |
+
model: <a href="https://huggingface.co/aslanconfig/tech-advisor-nemotron-4b" target="_blank">aslanconfig/tech-advisor-nemotron-4b</a> |
|
| 193 |
+
sponsor: nvidia | track: backyard
|
| 194 |
</div>
|
| 195 |
"""
|
| 196 |
|
| 197 |
# --- Gradio UI ---
|
| 198 |
+
with gr.Blocks(css=CSS, title="Local Tech Advisor") as demo:
|
| 199 |
gr.HTML(HEADER)
|
| 200 |
|
| 201 |
gr.ChatInterface(
|