Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,13 @@ from sentence_transformers.cross_encoder import CrossEncoder
|
|
11 |
from sklearn.metrics.pairwise import cosine_similarity
|
12 |
import os
|
13 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
Secret_token = os.getenv('HF_token')
|
16 |
|
@@ -56,7 +63,7 @@ def find_most_similar_matn(text, n):
|
|
56 |
matns = matns[is_taraf> .5]
|
57 |
return matns[['Book_Name', 'matn', 'taraf_ID', 'Book_ID', 'Hadith Number', 'Author', 'Similarity']]
|
58 |
|
59 |
-
with gr.Blocks() as demo:
|
60 |
text_input = gr.Textbox()
|
61 |
num_hadith = gr.Slider(1, 50, value = 5, label = 'Num Hadith', info = 'Choose the number of Hadith to Return', step = 1)
|
62 |
text_output = gr.DataFrame(wrap=True)
|
|
|
11 |
from sklearn.metrics.pairwise import cosine_similarity
|
12 |
import os
|
13 |
import gradio as gr
|
14 |
+
css = """
|
15 |
+
.table-wrap {
|
16 |
+
min-height: 300px;
|
17 |
+
max-height: 300px;
|
18 |
+
}
|
19 |
+
"""
|
20 |
+
|
21 |
|
22 |
Secret_token = os.getenv('HF_token')
|
23 |
|
|
|
63 |
matns = matns[is_taraf> .5]
|
64 |
return matns[['Book_Name', 'matn', 'taraf_ID', 'Book_ID', 'Hadith Number', 'Author', 'Similarity']]
|
65 |
|
66 |
+
with gr.Blocks(css=css) as demo:
|
67 |
text_input = gr.Textbox()
|
68 |
num_hadith = gr.Slider(1, 50, value = 5, label = 'Num Hadith', info = 'Choose the number of Hadith to Return', step = 1)
|
69 |
text_output = gr.DataFrame(wrap=True)
|