Spaces:
Runtime error
Runtime error
Commit
·
a92dc54
1
Parent(s):
591f48d
Update app.py
Browse files
app.py
CHANGED
@@ -88,6 +88,13 @@ def card(thumbnail: str, title: str, urls: list, contexts: list, starts: list, e
|
|
88 |
"""
|
89 |
return st.markdown(html, unsafe_allow_html=True)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
st.write("""
|
93 |
# YouTube Q&A
|
@@ -104,9 +111,22 @@ st.markdown("""
|
|
104 |
|
105 |
query = st.text_input("Search!", "")
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
if query != "":
|
|
|
108 |
print(f"query: {query}")
|
109 |
-
matches = make_query(
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
results = {}
|
112 |
order = []
|
|
|
88 |
"""
|
89 |
return st.markdown(html, unsafe_allow_html=True)
|
90 |
|
91 |
+
channel_map = {
|
92 |
+
'James Briggs': 'UCv83tO5cePwHMt1952IVVHw',
|
93 |
+
'Daniel Bourke': 'UCr8O8l5cCX85Oem1d18EezQ',
|
94 |
+
'Yannic Kilcher': 'UCZHmQk67mSJgfCCTn7xBfew',
|
95 |
+
'AI Coffee Break with Letitia': 'UCobqgqE4i5Kf7wrxRxhToQA',
|
96 |
+
'sentdex': 'UCfzlCWGWYyIQ0aLC5w48gBQ'
|
97 |
+
}
|
98 |
|
99 |
st.write("""
|
100 |
# YouTube Q&A
|
|
|
111 |
|
112 |
query = st.text_input("Search!", "")
|
113 |
|
114 |
+
with st.expander("Advanced Options"):
|
115 |
+
channel_options = st.multiselect(
|
116 |
+
'Channels to Search',
|
117 |
+
['James Briggs', 'Daniel Bourke', 'Yannic Kilcher', 'AI Coffee Break with Letitia', 'sentdex'],
|
118 |
+
['James Briggs', 'Daniel Bourke', 'Yannic Kilcher', 'AI Coffee Break with Letitia', 'sentdex']
|
119 |
+
)
|
120 |
+
|
121 |
if query != "":
|
122 |
+
channels = [channel_map[name] for name in channel_options]
|
123 |
print(f"query: {query}")
|
124 |
+
matches = make_query(
|
125 |
+
query, retriever, top_k=5,
|
126 |
+
filter={
|
127 |
+
'channel_id': {'$in': channels}
|
128 |
+
}
|
129 |
+
)
|
130 |
|
131 |
results = {}
|
132 |
order = []
|