Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ if "history" not in st.session_state:
|
|
| 9 |
st.session_state.history = []
|
| 10 |
|
| 11 |
st.sidebar.markdown("## Configuration")
|
| 12 |
-
|
| 13 |
-
models = ['text-davinci-003', 'text-curie-001
|
| 14 |
model = st.sidebar.selectbox("Select a model", models, index=0)
|
| 15 |
|
| 16 |
temperature = st.sidebar.slider("Temperature", 0.0, 1.0, 0.7)
|
|
@@ -26,7 +26,7 @@ st.sidebar.markdown("text-babbage-001 | 2,048 max tokens")
|
|
| 26 |
st.sidebar.markdown("text-ada-001 | 2,048 max tokens")
|
| 27 |
|
| 28 |
def generate_answer(prompt):
|
| 29 |
-
API_KEY =
|
| 30 |
API_URL = "https://api.openai.com/v1/completions"
|
| 31 |
headers = {
|
| 32 |
'Content-Type': 'application/json',
|
|
|
|
| 9 |
st.session_state.history = []
|
| 10 |
|
| 11 |
st.sidebar.markdown("## Configuration")
|
| 12 |
+
KEY = st.sidebar.text_input("Enter your OpenAI API key")
|
| 13 |
+
models = ['text-davinci-003', 'text-curie-001', 'text-babbage-001', 'text-ada-001']
|
| 14 |
model = st.sidebar.selectbox("Select a model", models, index=0)
|
| 15 |
|
| 16 |
temperature = st.sidebar.slider("Temperature", 0.0, 1.0, 0.7)
|
|
|
|
| 26 |
st.sidebar.markdown("text-ada-001 | 2,048 max tokens")
|
| 27 |
|
| 28 |
def generate_answer(prompt):
|
| 29 |
+
API_KEY = KEY
|
| 30 |
API_URL = "https://api.openai.com/v1/completions"
|
| 31 |
headers = {
|
| 32 |
'Content-Type': 'application/json',
|