diff --git a/requirements.txt b/requirements.txt index a23cb6a..5a05a4c 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/run.py b/run.py index 9c9ceb1..0fc71ab 100644 --- a/run.py +++ b/run.py @@ -2,4 +2,4 @@ from streamlit.web import bootstrap real_s_script = 'sp1_playground.py' real_w_script = 'wt2_playground.py' -bootstrap.run(real_s_script, f'run.py {real_s_script}', [], {}) \ No newline at end of file +bootstrap.run(real_s_script, f'run.py {real_s_script}', [], {}) diff --git a/wt2_playground.py b/wt2_playground.py index 63757ed..f3b24cf 100644 --- a/wt2_playground.py +++ b/wt2_playground.py @@ -1,3 +1,4 @@ +import streamlit as st import openai import os from dotenv import load_dotenv @@ -21,8 +22,7 @@ def generate_summarizer( temperature=float(temperature), top_p=float(top_p), frequency_penalty=float(frequency_penalty), - messages= - [ + messages=[ { "role": "system", "content": "You are a IELTS examiner.", @@ -51,8 +51,6 @@ def generate_summarizer( return res["choices"][0]["message"]["content"] -import streamlit as st - # Set the application title st.title("GPT-3.5 IELTS Examiner") @@ -63,7 +61,7 @@ st.title("GPT-3.5 IELTS Examiner") question_type = st.selectbox( "What is the question type?", ( - "Writing Task 2" + "Writing Task 2", ), ) @@ -79,10 +77,13 @@ answer = st.text_area("Enter the answer:", height=100) # Slider to control the model hyperparameter # with col1: -token = st.slider("Token", min_value=0.0, max_value=2000.0, value=1000.0, step=1.0) -temp = st.slider("Temperature", min_value=0.0, max_value=1.0, value=0.7, step=0.01) +token = st.slider("Token", min_value=0.0, + max_value=2000.0, value=1000.0, step=1.0) +temp = st.slider("Temperature", min_value=0.0, + max_value=1.0, value=0.7, step=0.01) top_p = st.slider("Top_p", min_value=0.0, max_value=1.0, value=0.9, step=0.01) -f_pen = st.slider("Frequency Penalty", min_value=-1.0, max_value=1.0, value=0.5, step=0.01) +f_pen = st.slider("Frequency Penalty", min_value=-1.0, + max_value=1.0, value=0.5, step=0.01) # Showing the current parameter used for the model # with col2: @@ -94,4 +95,5 @@ with st.expander("Current Parameter"): # Creating button for execute the text summarization if st.button("Grade"): - st.write(generate_summarizer(token, temp, top_p, f_pen, question_type, question, answer)) + st.write(generate_summarizer(token, temp, top_p, + f_pen, question_type, question, answer))