-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
36 lines (28 loc) · 976 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st
import os
from self_discover import SelfDiscover
st.set_page_config(
page_title="SELF-DISCOVER",
page_icon="🔍",
layout="wide",
initial_sidebar_state="expanded"
)
st.title("SELF-DISCOVER")
api_key = st.text_input("Enter OpenAI api key ")
task = st.text_area("Enter the task example you want to generate a reasoning structure for ")
if st.button("Generate Reasoning Structure"):
os.environ["OPENAI_API_KEY"] = api_key
result = SelfDiscover(task)
result()
tab1, tab2, tab3 = st.tabs(["SELECTED_MODULES", "ADAPTED_MODULES", "REASONING_STRUCTURE"])
with tab1:
st.header("SELECTED_MODULES")
st.write(result.selected_modules)
with tab2:
st.header("ADAPTED_MODULES")
st.write(result.adapted_modules)
with tab3:
st.header("REASONING_STRUCTURE")
st.write(result.reasoning_structure)
else:
st.error("Please provide both your API key and a task example.")