Spaces:
Paused
Paused
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"]) | |