Tom Aarsen
commited on
Commit
·
760f88c
1
Parent(s):
d86454c
Turn info section into HTML for Spaces; worked with Markdown only locally
Browse files
app.py
CHANGED
|
@@ -170,7 +170,7 @@ def search(
|
|
| 170 |
|
| 171 |
|
| 172 |
css = """
|
| 173 |
-
|
| 174 |
--block-padding: 0px;
|
| 175 |
}
|
| 176 |
"""
|
|
@@ -178,15 +178,16 @@ css = """
|
|
| 178 |
with gr.Blocks(title="Quantized Retrieval") as demo:
|
| 179 |
with gr.Row():
|
| 180 |
with gr.Column(scale=3):
|
| 181 |
-
gr.
|
| 182 |
"""
|
| 183 |
<div style='border: 1px solid var(--border-color-primary, #e0e0e0); border-radius: var(--block-radius); padding: 12px 14px; background-color: var(--block-background-fill, transparent);'>
|
| 184 |
|
| 185 |
<h1 style='margin-top: 0;'>Quantized Retrieval - Binary Search with Scalar (int8) Rescoring</h1>
|
| 186 |
|
| 187 |
-
This demo showcases retrieval using
|
| 188 |
</div>
|
| 189 |
-
"""
|
|
|
|
| 190 |
)
|
| 191 |
with gr.Accordion("Click to learn about the retrieval process", open=False):
|
| 192 |
gr.Markdown(
|
|
@@ -212,7 +213,7 @@ Feel free to check out the [code for this demo](https://huggingface.co/spaces/se
|
|
| 212 |
Notes:
|
| 213 |
- The approximate search index (a binary Inverted File Index (IVF)) is in beta and has not been trained with a lot of data.
|
| 214 |
"""
|
| 215 |
-
|
| 216 |
query = gr.Textbox(
|
| 217 |
label="Query for Wikipedia articles",
|
| 218 |
placeholder="Enter a query to search for relevant texts from Wikipedia.",
|
|
@@ -243,7 +244,7 @@ Notes:
|
|
| 243 |
|
| 244 |
with gr.Row():
|
| 245 |
with gr.Column(scale=3):
|
| 246 |
-
cards = gr.HTML(label="Results",
|
| 247 |
with gr.Column(scale=1):
|
| 248 |
summary = gr.Markdown(label="Search Summary")
|
| 249 |
|
|
|
|
| 170 |
|
| 171 |
|
| 172 |
css = """
|
| 173 |
+
.no-pad-container {
|
| 174 |
--block-padding: 0px;
|
| 175 |
}
|
| 176 |
"""
|
|
|
|
| 178 |
with gr.Blocks(title="Quantized Retrieval") as demo:
|
| 179 |
with gr.Row():
|
| 180 |
with gr.Column(scale=3):
|
| 181 |
+
gr.HTML(
|
| 182 |
"""
|
| 183 |
<div style='border: 1px solid var(--border-color-primary, #e0e0e0); border-radius: var(--block-radius); padding: 12px 14px; background-color: var(--block-background-fill, transparent);'>
|
| 184 |
|
| 185 |
<h1 style='margin-top: 0;'>Quantized Retrieval - Binary Search with Scalar (int8) Rescoring</h1>
|
| 186 |
|
| 187 |
+
This demo showcases retrieval using<a href="https://huggingface.co/blog/embedding-quantization" style="padding-left: 0.5ch; padding-right: 0.5ch;">quantized embeddings</a>on a CPU. The corpus consists of<a href="https://huggingface.co/datasets/sentence-transformers/quantized-retrieval-data" style="padding-left: 0.5ch; padding-right: 0.5ch;">41 million texts</a>from Wikipedia articles.
|
| 188 |
</div>
|
| 189 |
+
""",
|
| 190 |
+
elem_classes="no-pad-container",
|
| 191 |
)
|
| 192 |
with gr.Accordion("Click to learn about the retrieval process", open=False):
|
| 193 |
gr.Markdown(
|
|
|
|
| 213 |
Notes:
|
| 214 |
- The approximate search index (a binary Inverted File Index (IVF)) is in beta and has not been trained with a lot of data.
|
| 215 |
"""
|
| 216 |
+
)
|
| 217 |
query = gr.Textbox(
|
| 218 |
label="Query for Wikipedia articles",
|
| 219 |
placeholder="Enter a query to search for relevant texts from Wikipedia.",
|
|
|
|
| 244 |
|
| 245 |
with gr.Row():
|
| 246 |
with gr.Column(scale=3):
|
| 247 |
+
cards = gr.HTML(label="Results", elem_classes="no-pad-container")
|
| 248 |
with gr.Column(scale=1):
|
| 249 |
summary = gr.Markdown(label="Search Summary")
|
| 250 |
|