Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +12 -11
src/streamlit_app.py
CHANGED
|
@@ -60,7 +60,7 @@ ls_client = get_langsmith()
|
|
| 60 |
# =========================
|
| 61 |
# SAMPLE SEED (with full debug fields)
|
| 62 |
# =========================
|
| 63 |
-
SAMPLE_QUESTION = "
|
| 64 |
|
| 65 |
DEFAULT_SYSTEM_PROMPT = (
|
| 66 |
"You are Teapot, an open-source AI assistant optimized for running on low-end cpu devices, "
|
|
@@ -295,7 +295,7 @@ for i, msg in enumerate(st.session_state.messages):
|
|
| 295 |
continue
|
| 296 |
|
| 297 |
# Row 1
|
| 298 |
-
msg_col, fb_col = st.columns([
|
| 299 |
with msg_col:
|
| 300 |
st.markdown(msg.get("content", ""))
|
| 301 |
with fb_col:
|
|
@@ -310,9 +310,18 @@ for i, msg in enumerate(st.session_state.messages):
|
|
| 310 |
)
|
| 311 |
|
| 312 |
# Row 2
|
| 313 |
-
inspect_col, metrics_col = st.columns([
|
| 314 |
|
| 315 |
with inspect_col:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
with st.popover("ℹ️", help="Inspect"):
|
| 317 |
st.markdown("**Context**")
|
| 318 |
st.code(msg.get("context", ""), language="text")
|
|
@@ -323,14 +332,6 @@ for i, msg in enumerate(st.session_state.messages):
|
|
| 323 |
st.markdown("**Prompt**")
|
| 324 |
st.code(msg.get("prompt", ""), language="text")
|
| 325 |
|
| 326 |
-
with metrics_col:
|
| 327 |
-
st.caption(
|
| 328 |
-
f"🔎 {msg.get('search_time', 0.0):.2f}s (search) "
|
| 329 |
-
f"🧠 {msg.get('gen_time', 0.0):.2f}s (generation) "
|
| 330 |
-
f"⚡ {msg.get('tps', 0.0):.1f} tok/s "
|
| 331 |
-
f"🧾 {msg.get('input_tokens', 0)} input tokens • {msg.get('output_tokens', 0)} output tokens"
|
| 332 |
-
)
|
| 333 |
-
|
| 334 |
|
| 335 |
# =========================
|
| 336 |
# INPUT
|
|
|
|
| 60 |
# =========================
|
| 61 |
# SAMPLE SEED (with full debug fields)
|
| 62 |
# =========================
|
| 63 |
+
SAMPLE_QUESTION = "Who are you?"
|
| 64 |
|
| 65 |
DEFAULT_SYSTEM_PROMPT = (
|
| 66 |
"You are Teapot, an open-source AI assistant optimized for running on low-end cpu devices, "
|
|
|
|
| 295 |
continue
|
| 296 |
|
| 297 |
# Row 1
|
| 298 |
+
msg_col, fb_col = st.columns([12, 1], vertical_alignment="center")
|
| 299 |
with msg_col:
|
| 300 |
st.markdown(msg.get("content", ""))
|
| 301 |
with fb_col:
|
|
|
|
| 310 |
)
|
| 311 |
|
| 312 |
# Row 2
|
| 313 |
+
inspect_col, metrics_col = st.columns([12, 1], vertical_alignment="center")
|
| 314 |
|
| 315 |
with inspect_col:
|
| 316 |
+
st.caption(
|
| 317 |
+
f"🔎 {msg.get('search_time', 0.0):.2f}s (search) "
|
| 318 |
+
f"🧠 {msg.get('gen_time', 0.0):.2f}s (generation) "
|
| 319 |
+
f"⚡ {msg.get('tps', 0.0):.1f} tok/s "
|
| 320 |
+
f"🧾 {msg.get('input_tokens', 0)} input tokens • {msg.get('output_tokens', 0)} output tokens"
|
| 321 |
+
)
|
| 322 |
+
|
| 323 |
+
with metrics_col:
|
| 324 |
+
|
| 325 |
with st.popover("ℹ️", help="Inspect"):
|
| 326 |
st.markdown("**Context**")
|
| 327 |
st.code(msg.get("context", ""), language="text")
|
|
|
|
| 332 |
st.markdown("**Prompt**")
|
| 333 |
st.code(msg.get("prompt", ""), language="text")
|
| 334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
|
| 336 |
# =========================
|
| 337 |
# INPUT
|