Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import openai
|
|
5 |
from llama_index import SimpleDirectoryReader
|
6 |
|
7 |
st.set_page_config(page_title="You & AI - Parks", page_icon="π", layout="centered", initial_sidebar_state="auto", menu_items=None)
|
8 |
-
openai.api_key = "
|
9 |
st.title("Personalize Your Parks Experience π¬ππ€")
|
10 |
st.info("Check out more info on DC Parks & Rec at our [website](https://dpr.dc.gov/)", icon="π")
|
11 |
|
@@ -16,7 +16,7 @@ if "messages" not in st.session_state.keys(): # Initialize the chat messages his
|
|
16 |
|
17 |
@st.cache_resource(show_spinner=False)
|
18 |
def load_data():
|
19 |
-
with st.spinner(text="Loading and indexing the
|
20 |
reader = SimpleDirectoryReader(input_dir="./data", recursive=True)
|
21 |
docs = reader.load_data()
|
22 |
service_context = ServiceContext.from_defaults(llm=OpenAI(model="gpt-3.5-turbo", temperature=0.5, system_prompt="You are an expert on the Streamlit Python library and your job is to answer technical questions. Assume that all questions are related to the Streamlit Python library. Keep your answers technical and based on facts β do not hallucinate features."))
|
|
|
5 |
from llama_index import SimpleDirectoryReader
|
6 |
|
7 |
st.set_page_config(page_title="You & AI - Parks", page_icon="π", layout="centered", initial_sidebar_state="auto", menu_items=None)
|
8 |
+
openai.api_key = "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"
|
9 |
st.title("Personalize Your Parks Experience π¬ππ€")
|
10 |
st.info("Check out more info on DC Parks & Rec at our [website](https://dpr.dc.gov/)", icon="π")
|
11 |
|
|
|
16 |
|
17 |
@st.cache_resource(show_spinner=False)
|
18 |
def load_data():
|
19 |
+
with st.spinner(text="Loading and indexing the DC Parks & Rec docs β hang tight! This should take 1-2 minutes."):
|
20 |
reader = SimpleDirectoryReader(input_dir="./data", recursive=True)
|
21 |
docs = reader.load_data()
|
22 |
service_context = ServiceContext.from_defaults(llm=OpenAI(model="gpt-3.5-turbo", temperature=0.5, system_prompt="You are an expert on the Streamlit Python library and your job is to answer technical questions. Assume that all questions are related to the Streamlit Python library. Keep your answers technical and based on facts β do not hallucinate features."))
|