Updated the requirements

This commit is contained in:
Tiago Ribeiro
2023-06-20 23:23:22 +01:00
parent 07e68e2650
commit 7cd67265db
3 changed files with 12 additions and 10 deletions

Binary file not shown.

2
run.py
View File

@@ -2,4 +2,4 @@ from streamlit.web import bootstrap
real_s_script = 'sp1_playground.py' real_s_script = 'sp1_playground.py'
real_w_script = 'wt2_playground.py' real_w_script = 'wt2_playground.py'
bootstrap.run(real_s_script, f'run.py {real_s_script}', [], {}) bootstrap.run(real_s_script, f'run.py {real_s_script}', [], {})

View File

@@ -1,3 +1,4 @@
import streamlit as st
import openai import openai
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
@@ -21,8 +22,7 @@ def generate_summarizer(
temperature=float(temperature), temperature=float(temperature),
top_p=float(top_p), top_p=float(top_p),
frequency_penalty=float(frequency_penalty), frequency_penalty=float(frequency_penalty),
messages= messages=[
[
{ {
"role": "system", "role": "system",
"content": "You are a IELTS examiner.", "content": "You are a IELTS examiner.",
@@ -51,8 +51,6 @@ def generate_summarizer(
return res["choices"][0]["message"]["content"] return res["choices"][0]["message"]["content"]
import streamlit as st
# Set the application title # Set the application title
st.title("GPT-3.5 IELTS Examiner") st.title("GPT-3.5 IELTS Examiner")
@@ -63,7 +61,7 @@ st.title("GPT-3.5 IELTS Examiner")
question_type = st.selectbox( question_type = st.selectbox(
"What is the question type?", "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 # Slider to control the model hyperparameter
# with col1: # with col1:
token = st.slider("Token", min_value=0.0, max_value=2000.0, value=1000.0, step=1.0) token = st.slider("Token", min_value=0.0,
temp = st.slider("Temperature", min_value=0.0, max_value=1.0, value=0.7, step=0.01) 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) 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 # Showing the current parameter used for the model
# with col2: # with col2:
@@ -94,4 +95,5 @@ with st.expander("Current Parameter"):
# Creating button for execute the text summarization # Creating button for execute the text summarization
if st.button("Grade"): 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))