Commit
•
35db041
1
Parent(s):
88231f7
add rag search
Browse files- ragatouille_search.py +4 -3
ragatouille_search.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
from pathlib import Path
|
|
|
|
|
2 |
import gradio as gr
|
3 |
from huggingface_hub import snapshot_download
|
4 |
from ragatouille import RAGPretrainedModel
|
5 |
from toolz import unique
|
6 |
-
from typing import List, Dict, Any
|
7 |
|
8 |
# Top-level variables
|
9 |
INDEX_PATH = Path(".ragatouille/colbert/indexes/my_index_with_ids_and_metadata/")
|
@@ -81,9 +82,9 @@ def create_ragatouille_interface():
|
|
81 |
Feel free to open a discussion to give feedback or request features 🤗
|
82 |
"""
|
83 |
)
|
84 |
-
|
85 |
-
query = gr.Textbox(label="Search query", placeholder="medieval handwriting")
|
86 |
with gr.Column():
|
|
|
|
|
87 |
k = gr.Slider(1, 100, value=DEFAULT_K, step=1, label="Number of Results")
|
88 |
make_unique = gr.Checkbox(False, label="Show each dataset only once?")
|
89 |
search_button = gr.Button("Search")
|
|
|
1 |
from pathlib import Path
|
2 |
+
from typing import Any, Dict, List
|
3 |
+
|
4 |
import gradio as gr
|
5 |
from huggingface_hub import snapshot_download
|
6 |
from ragatouille import RAGPretrainedModel
|
7 |
from toolz import unique
|
|
|
8 |
|
9 |
# Top-level variables
|
10 |
INDEX_PATH = Path(".ragatouille/colbert/indexes/my_index_with_ids_and_metadata/")
|
|
|
82 |
Feel free to open a discussion to give feedback or request features 🤗
|
83 |
"""
|
84 |
)
|
|
|
|
|
85 |
with gr.Column():
|
86 |
+
query = gr.Textbox(label="Search query", placeholder="medieval handwriting")
|
87 |
+
with gr.Row():
|
88 |
k = gr.Slider(1, 100, value=DEFAULT_K, step=1, label="Number of Results")
|
89 |
make_unique = gr.Checkbox(False, label="Show each dataset only once?")
|
90 |
search_button = gr.Button("Search")
|