Spaces:
Running
Running
Rename to OpenWormLLM for now
Browse files
app.py
CHANGED
|
@@ -16,13 +16,13 @@ from ring import get_openai_api_key
|
|
| 16 |
from ring import generate_response
|
| 17 |
from ring import generate_panel_response
|
| 18 |
|
| 19 |
-
__version__ = "0.
|
| 20 |
|
| 21 |
col1, col2 = st.columns([3, 1])
|
| 22 |
|
| 23 |
with col1:
|
| 24 |
-
st.title("
|
| 25 |
-
st.markdown("**
|
| 26 |
|
| 27 |
with col2:
|
| 28 |
st.image("images/OpenWormLogo.png")
|
|
@@ -43,7 +43,7 @@ tab_free, tab_panel, tab_pubs, tab_data, tab_corpus, tab_model, tab_about = st.t
|
|
| 43 |
|
| 44 |
with tab_free:
|
| 45 |
|
| 46 |
-
st.markdown("**Ask individual LLMs questions**")
|
| 47 |
|
| 48 |
with st.form("form_free"):
|
| 49 |
|
|
@@ -57,7 +57,7 @@ with tab_free:
|
|
| 57 |
temperature = st.text_input("Temperature", value=0.1)
|
| 58 |
|
| 59 |
only_celegans = st.checkbox(
|
| 60 |
-
"Only answer questions related to _C. elegans_", value=True
|
| 61 |
)
|
| 62 |
|
| 63 |
submitted = st.form_submit_button("Submit")
|
|
@@ -83,18 +83,26 @@ with tab_panel:
|
|
| 83 |
temperature = st.text_input("Temperature", value=0.1)
|
| 84 |
|
| 85 |
###Start of Kaan Changes
|
| 86 |
-
#Selectbox to determine which LLM becomes panel lead
|
| 87 |
-
panel_lead = st.radio(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
-
#Create checkboxes to determine which LLMs are included in the panel
|
| 90 |
-
st.markdown(
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
| 92 |
selected_options = []
|
| 93 |
-
#Put checkboxes into columns to be arranged horizontally
|
| 94 |
cols = st.columns(len(options))
|
|
|
|
| 95 |
for i, option in enumerate(options):
|
| 96 |
with cols[i]:
|
| 97 |
-
selected = st.checkbox(option, key=option)
|
| 98 |
if selected:
|
| 99 |
selected_options.append(option)
|
| 100 |
|
|
@@ -107,8 +115,8 @@ with tab_panel:
|
|
| 107 |
elif requires_openai_key(llm_ver) and not get_openai_api_key():
|
| 108 |
st.info("Please add your OpenAI API key to continue.")
|
| 109 |
elif submitted:
|
| 110 |
-
#Create new list of LLMs that does not include panel lead
|
| 111 |
-
llm_panelists = [llm for llm in selected_options if llm !=panel_lead]
|
| 112 |
response = generate_panel_response(
|
| 113 |
text,
|
| 114 |
llm_panelists=llm_panelists,
|
|
|
|
| 16 |
from ring import generate_response
|
| 17 |
from ring import generate_panel_response
|
| 18 |
|
| 19 |
+
__version__ = "0.2.0"
|
| 20 |
|
| 21 |
col1, col2 = st.columns([3, 1])
|
| 22 |
|
| 23 |
with col1:
|
| 24 |
+
st.title("OpenWormLLM")
|
| 25 |
+
st.markdown("**v%s** - Note: work in progress!" % __version__)
|
| 26 |
|
| 27 |
with col2:
|
| 28 |
st.image("images/OpenWormLogo.png")
|
|
|
|
| 43 |
|
| 44 |
with tab_free:
|
| 45 |
|
| 46 |
+
st.markdown("**Ask individual LLMs questions about _C. elegans_**")
|
| 47 |
|
| 48 |
with st.form("form_free"):
|
| 49 |
|
|
|
|
| 57 |
temperature = st.text_input("Temperature", value=0.1)
|
| 58 |
|
| 59 |
only_celegans = st.checkbox(
|
| 60 |
+
"Only answer questions related to _C. elegans_", value=True, disabled=True
|
| 61 |
)
|
| 62 |
|
| 63 |
submitted = st.form_submit_button("Submit")
|
|
|
|
| 83 |
temperature = st.text_input("Temperature", value=0.1)
|
| 84 |
|
| 85 |
###Start of Kaan Changes
|
| 86 |
+
# Selectbox to determine which LLM becomes panel lead
|
| 87 |
+
panel_lead = st.radio(
|
| 88 |
+
"Which LLM would you like to lead this panel?",
|
| 89 |
+
PREF_ORDER_LLMS,
|
| 90 |
+
horizontal=True,
|
| 91 |
+
)
|
| 92 |
|
| 93 |
+
# Create checkboxes to determine which LLMs are included in the panel
|
| 94 |
+
st.markdown(
|
| 95 |
+
"<div style='text-align: left; font-size: 14px;'>Which LLMs would you like to attend the panel?</div>",
|
| 96 |
+
unsafe_allow_html=True,
|
| 97 |
+
)
|
| 98 |
+
options = PREF_ORDER_LLMS # [llm for llm in PREF_ORDER_LLMS if llm !=panel_lead] creates a list of options excluding the chosen panel lead
|
| 99 |
selected_options = []
|
| 100 |
+
# Put checkboxes into columns to be arranged horizontally
|
| 101 |
cols = st.columns(len(options))
|
| 102 |
+
|
| 103 |
for i, option in enumerate(options):
|
| 104 |
with cols[i]:
|
| 105 |
+
selected = st.checkbox(option, key=option, value=(i != 0))
|
| 106 |
if selected:
|
| 107 |
selected_options.append(option)
|
| 108 |
|
|
|
|
| 115 |
elif requires_openai_key(llm_ver) and not get_openai_api_key():
|
| 116 |
st.info("Please add your OpenAI API key to continue.")
|
| 117 |
elif submitted:
|
| 118 |
+
# Create new list of LLMs that does not include panel lead
|
| 119 |
+
llm_panelists = [llm for llm in selected_options if llm != panel_lead]
|
| 120 |
response = generate_panel_response(
|
| 121 |
text,
|
| 122 |
llm_panelists=llm_panelists,
|