Spaces:
Runtime error
Runtime error
style
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Sample Streamlit Search
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: red
|
| 6 |
sdk: streamlit
|
|
|
|
| 1 |
---
|
| 2 |
title: Sample Streamlit Search
|
| 3 |
+
emoji: 🌿
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: red
|
| 6 |
sdk: streamlit
|
app.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import streamlit as st
|
| 3 |
import streamlit.components.v1 as components
|
| 4 |
from datasets import load_dataset
|
| 5 |
from pyserini.search.lucene import LuceneSearcher
|
| 6 |
|
| 7 |
-
st.set_page_config(page_title="
|
| 8 |
|
| 9 |
|
| 10 |
st.sidebar.markdown(
|
|
@@ -13,10 +14,10 @@ st.sidebar.markdown(
|
|
| 13 |
.aligncenter {
|
| 14 |
text-align: center;
|
| 15 |
font-weight: bold;
|
| 16 |
-
font-size:
|
| 17 |
}
|
| 18 |
</style>
|
| 19 |
-
<p class="aligncenter">
|
| 20 |
""",
|
| 21 |
unsafe_allow_html=True,
|
| 22 |
)
|
|
@@ -66,13 +67,12 @@ if st.sidebar.button("Search"):
|
|
| 66 |
results = search(query)
|
| 67 |
results_html = ""
|
| 68 |
for result in results:
|
| 69 |
-
results_html += result + "<br><hr><br>"
|
| 70 |
rendered_results = f"""
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
"""
|
| 76 |
|
| 77 |
components.html(
|
| 78 |
rendered_results,
|
|
|
|
| 1 |
import os
|
| 2 |
+
|
| 3 |
import streamlit as st
|
| 4 |
import streamlit.components.v1 as components
|
| 5 |
from datasets import load_dataset
|
| 6 |
from pyserini.search.lucene import LuceneSearcher
|
| 7 |
|
| 8 |
+
st.set_page_config(page_title="IMDB Search", layout="wide")
|
| 9 |
|
| 10 |
|
| 11 |
st.sidebar.markdown(
|
|
|
|
| 14 |
.aligncenter {
|
| 15 |
text-align: center;
|
| 16 |
font-weight: bold;
|
| 17 |
+
font-size: 28px;
|
| 18 |
}
|
| 19 |
</style>
|
| 20 |
+
<p class="aligncenter">IMDB Search</p>
|
| 21 |
""",
|
| 22 |
unsafe_allow_html=True,
|
| 23 |
)
|
|
|
|
| 67 |
results = search(query)
|
| 68 |
results_html = ""
|
| 69 |
for result in results:
|
| 70 |
+
results_html += result + "<br><br><hr><br>"
|
| 71 |
rendered_results = f"""
|
| 72 |
+
<div id="searchresultsarea">
|
| 73 |
+
{results_html}
|
| 74 |
+
</div>
|
| 75 |
+
"""
|
|
|
|
| 76 |
|
| 77 |
components.html(
|
| 78 |
rendered_results,
|