GPT3-summary / app.py
Davide Fiocco
Add basic functionality
6f4648b
raw
history blame
470 Bytes
import streamlit as st
import openai
key = st.text_input("Insert OpenAI API key")
prompt = st.text_area("Insert French text to summarize")
if (key and prompt):
openai.api_key = key
result = openai.Completion.create(
engine ="davinci",
prompt= f"{prompt} \n\n tl;dr ",
temperature=0.00,
max_tokens=20,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)
st.write("Summary:")
st.write(result["choices"][0]["text"])