Spaces:
Runtime error
Runtime error
Commit
·
6b77300
1
Parent(s):
5b2ab3e
Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,10 @@ import logging
|
|
6 |
PINECONE_KEY = st.secrets["PINECONE_KEY"] # app.pinecone.io
|
7 |
INDEX_ID = 'ask-youtube'
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
@st.experimental_singleton
|
15 |
-
def init_template():
|
16 |
-
local_css("https://huggingface.co/spaces/jamescalam/ask-youtube/raw/main/styles.css")
|
17 |
|
18 |
@st.experimental_singleton
|
19 |
def init_pinecone():
|
@@ -49,7 +45,6 @@ def make_query(query, retriever, top_k=10, include_values=True, include_metadata
|
|
49 |
logging.error(f"Query failed")
|
50 |
return matches
|
51 |
|
52 |
-
init_template()
|
53 |
st.session_state.index = init_pinecone()
|
54 |
retriever = init_retriever()
|
55 |
|
|
|
6 |
PINECONE_KEY = st.secrets["PINECONE_KEY"] # app.pinecone.io
|
7 |
INDEX_ID = 'ask-youtube'
|
8 |
|
9 |
+
file_name = https://huggingface.co/spaces/jamescalam/ask-youtube/raw/main/styles.css"
|
10 |
+
st.markdown('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">', unsafe_allow_html=True)
|
11 |
+
with open(file_name) as f:
|
12 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
13 |
|
14 |
@st.experimental_singleton
|
15 |
def init_pinecone():
|
|
|
45 |
logging.error(f"Query failed")
|
46 |
return matches
|
47 |
|
|
|
48 |
st.session_state.index = init_pinecone()
|
49 |
retriever = init_retriever()
|
50 |
|