Spaces:
Build error
Build error
Download app.py from davidbelow/cia: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/spaces/davidbelow/cia/resolve/main/app.py
- Command line
-
hf download hf://spaces/davidbelow/cia/app.py
-
curl -L -o app.py https://huggingface.co/spaces/davidbelow/cia/resolve/main/app.py
607 Bytes
| import streamlit as st | |
| from langchain.llms import OpenAI | |
| st.title("Conversational Information Access (CIA)") | |
| with st.sidebar: | |
| openai_api_key = st.secrets["OPEN_API_KEY"] | |
| def generate_response(input_text): | |
| llm = OpenAI(temperature=0.7, openai_api_key=openai_api_key) | |
| st.info(llm(input_text)) | |
| with st.form("my_form"): | |
| text = st.text_area("Enter text:", "What are the latest updates from my team?") | |
| submitted = st.form_submit_button("Submit") | |
| if not openai_api_key: | |
| st.info("Please add your OpenAI API key to continue.") | |
| elif submitted: | |
| generate_response(text) |