Download app.py from mpolanco/gpt3: direct link, hf CLI and curl.
- Browser
- Download file 419 Bytes
-
https://huggingface.co/spaces/mpolanco/gpt3/resolve/main/app.py
- Command line
-
hf download hf://spaces/mpolanco/gpt3/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mpolanco/gpt3/resolve/main/app.py
419 Bytes
| import openai | |
| import streamlit as st | |
| openai.api_key = st.secrets["SECRET_KEY"] | |
| st.title('GPT-3') | |
| st.text('This GPT-3 model is the Davinci-engine') | |
| prompt_text = st.text_input(label="Add here phrase, which you want to be completed", value="Add here few words") | |
| response = openai.Completion.create(engine="davinci", prompt=prompt_text, max_tokens=5) | |
| st.text('Remaining phrase:') | |
| st.text(response["choices"][0]["text"]) |