Spaces:
Runtime error
Runtime error
Added a push button to generate a random question to the UI, so users don't have to phrase something themselves.
Browse files
pages/010_LLM_Architectures.py
CHANGED
@@ -4,6 +4,7 @@ import streamlit as st
|
|
4 |
from time import time
|
5 |
|
6 |
from src.st_helpers import st_setup
|
|
|
7 |
from src.common import img_dir, escape_dollars, generate_group_tag
|
8 |
from src.architectures import *
|
9 |
|
@@ -31,6 +32,8 @@ def show_side_by_side() -> None:
|
|
31 |
st.write("To get started select some architectures to compare")
|
32 |
else:
|
33 |
prompt = st.chat_input("Ask a question")
|
|
|
|
|
34 |
if prompt:
|
35 |
st.write(f"**Question:** {prompt}")
|
36 |
|
@@ -98,12 +101,17 @@ def show_architecture(architecture: str) -> None:
|
|
98 |
st.write(f"### Chat with {arch.name}")
|
99 |
st.write("Note this is a simple single query through the relevant architecture. This is just a sample so you can interact with it and does not manage a chat session history.")
|
100 |
|
|
|
|
|
|
|
|
|
101 |
chat_col, trace_col, request_col = st.columns([3, 2, 2])
|
102 |
|
103 |
with chat_col:
|
104 |
with st.chat_message("assistant"):
|
105 |
st.write("Chat with me in the box below")
|
106 |
-
|
|
|
107 |
with chat_col:
|
108 |
with st.chat_message("user"):
|
109 |
st.write(prompt)
|
|
|
4 |
from time import time
|
5 |
|
6 |
from src.st_helpers import st_setup
|
7 |
+
from src.data_synthesis.test_question_generator import generate_question
|
8 |
from src.common import img_dir, escape_dollars, generate_group_tag
|
9 |
from src.architectures import *
|
10 |
|
|
|
32 |
st.write("To get started select some architectures to compare")
|
33 |
else:
|
34 |
prompt = st.chat_input("Ask a question")
|
35 |
+
if st.button("Or press to ask a random question"):
|
36 |
+
prompt = generate_question()
|
37 |
if prompt:
|
38 |
st.write(f"**Question:** {prompt}")
|
39 |
|
|
|
101 |
st.write(f"### Chat with {arch.name}")
|
102 |
st.write("Note this is a simple single query through the relevant architecture. This is just a sample so you can interact with it and does not manage a chat session history.")
|
103 |
|
104 |
+
prompt = st.chat_input("Ask a question")
|
105 |
+
if st.button("Or press to ask a random question"):
|
106 |
+
prompt = generate_question()
|
107 |
+
|
108 |
chat_col, trace_col, request_col = st.columns([3, 2, 2])
|
109 |
|
110 |
with chat_col:
|
111 |
with st.chat_message("assistant"):
|
112 |
st.write("Chat with me in the box below")
|
113 |
+
|
114 |
+
if prompt:
|
115 |
with chat_col:
|
116 |
with st.chat_message("user"):
|
117 |
st.write(prompt)
|