CoolFace
Apppublic

kailashsp/SELF-DISCOVER

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
2likes
app.py37 linesDownload Raw Back to root
1import streamlit as st2import os3from self_discover import SelfDiscover4 5 6st.set_page_config(7    page_title="SELF-DISCOVER",8    page_icon="๐Ÿ”",9    layout="wide",10    initial_sidebar_state="expanded"11)12st.title("SELF-DISCOVER")13 14 15api_key = st.text_input("Enter OpenAI api key ")16task = st.text_area("Enter the task example you want to generate a reasoning structure for ")17 18if st.button("Generate Reasoning Structure"):19    os.environ["OPENAI_API_KEY"] = api_key20    result = SelfDiscover(task)21    result()22    tab1, tab2, tab3 = st.tabs(["SELECTED_MODULES", "ADAPTED_MODULES", "REASONING_STRUCTURE"])23    with tab1:24        st.header("SELECTED_MODULES")25        st.write(result.selected_modules)26 27    with tab2:28        st.header("ADAPTED_MODULES") 29        st.write(result.adapted_modules)30 31    with tab3:32        st.header("REASONING_STRUCTURE") 33        st.write(result.reasoning_structure)34else:35    st.error("Please provide both your API key and a task example.")36 37