Spaces:
Sleeping
Sleeping
etadevosyan
commited on
Commit
•
043145c
1
Parent(s):
2065044
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ from transformers import BertTokenizer
|
|
5 |
from rank_bm25 import BM25Okapi
|
6 |
import gradio as gr
|
7 |
|
|
|
|
|
|
|
8 |
tokenizer = BertTokenizer.from_pretrained("DeepPavlov/rubert-base-cased")
|
9 |
|
10 |
f = open('budu_search_syn_database.json')
|
@@ -32,7 +35,7 @@ def predict_bm25(service):
|
|
32 |
demo = gr.Interface(fn=predict_bm25,inputs=gr.components.Textbox(label='Запрос пользователя'),
|
33 |
outputs=[gr.components.Textbox(label='Рекомендованные услуги')],
|
34 |
allow_flagging='manual',
|
35 |
-
flagging_callback =
|
36 |
examples=[
|
37 |
['кальций'],
|
38 |
['узи'],
|
|
|
5 |
from rank_bm25 import BM25Okapi
|
6 |
import gradio as gr
|
7 |
|
8 |
+
HF_TOKEN = os.getenv('HF_TOKEN')
|
9 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "budu_search_data")
|
10 |
+
|
11 |
tokenizer = BertTokenizer.from_pretrained("DeepPavlov/rubert-base-cased")
|
12 |
|
13 |
f = open('budu_search_syn_database.json')
|
|
|
35 |
demo = gr.Interface(fn=predict_bm25,inputs=gr.components.Textbox(label='Запрос пользователя'),
|
36 |
outputs=[gr.components.Textbox(label='Рекомендованные услуги')],
|
37 |
allow_flagging='manual',
|
38 |
+
flagging_callback = hf_writer,
|
39 |
examples=[
|
40 |
['кальций'],
|
41 |
['узи'],
|