bradley6597
commited on
Remove logging temporarily
Browse files
app.py
CHANGED
@@ -14,17 +14,17 @@ import re
|
|
14 |
|
15 |
login(token = os.environ['HUB_TOKEN'])
|
16 |
|
17 |
-
logger = gr.HuggingFaceDatasetSaver(os.environ['HUB_TOKEN'], dataset_name='illustration_gdrive_logging_main', private=True)
|
18 |
-
logger.setup([gr.Text(label="clicked_url"), gr.Text(label="seach_term"), gr.Text(label = 'sessionhash'), gr.Text(label = 'datetime')], './flagged_data_points')
|
19 |
|
20 |
|
21 |
-
logging_js = '''
|
22 |
-
function magicFunc(x){
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
}
|
27 |
-
'''
|
28 |
|
29 |
dataset = load_dataset("bradley6597/illustration-test", data_files = 'data.csv')
|
30 |
df = pd.DataFrame(dataset['train']).drop_duplicates()
|
@@ -194,7 +194,7 @@ def search_index(search_text, sd, ks, sort_by, max_results, user_num, search_tit
|
|
194 |
|
195 |
def search_logging(x: str, request: gr.Request):
|
196 |
session_id = getattr(request.cookies, 'access-token')
|
197 |
-
logger.flag(['', x, session_id, str(datetime.now())])
|
198 |
|
199 |
back_to_top_btn_html = '''
|
200 |
<button id="toTopBtn" onclick="'parentIFrame' in window ? window.parentIFrame.scrollTo({top: 0, behavior:'smooth'}) : window.scrollTo({ top: 0 })">
|
@@ -268,7 +268,9 @@ td img{
|
|
268 |
}
|
269 |
'''
|
270 |
|
271 |
-
with gr.Blocks(css=style
|
|
|
|
|
272 |
with gr.Row():
|
273 |
with gr.Column(min_width = 10):
|
274 |
with gr.Row():
|
@@ -323,7 +325,7 @@ async def track(url: str, q: str, request: Request):
|
|
323 |
if q is None:
|
324 |
q = ''
|
325 |
|
326 |
-
logger.flag([url, q, request.cookies['access-token'], str(datetime.now())])
|
327 |
return {"message": "ok"}
|
328 |
|
329 |
# mount Gradio app to FastAPI app
|
|
|
14 |
|
15 |
login(token = os.environ['HUB_TOKEN'])
|
16 |
|
17 |
+
# logger = gr.HuggingFaceDatasetSaver(os.environ['HUB_TOKEN'], dataset_name='illustration_gdrive_logging_main', private=True)
|
18 |
+
# logger.setup([gr.Text(label="clicked_url"), gr.Text(label="seach_term"), gr.Text(label = 'sessionhash'), gr.Text(label = 'datetime')], './flagged_data_points')
|
19 |
|
20 |
|
21 |
+
# logging_js = '''
|
22 |
+
# function magicFunc(x){
|
23 |
+
# let script = document.createElement('script');
|
24 |
+
# script.src = "file/js_functions.js"
|
25 |
+
# document.head.appendChild(script);
|
26 |
+
# }
|
27 |
+
# '''
|
28 |
|
29 |
dataset = load_dataset("bradley6597/illustration-test", data_files = 'data.csv')
|
30 |
df = pd.DataFrame(dataset['train']).drop_duplicates()
|
|
|
194 |
|
195 |
def search_logging(x: str, request: gr.Request):
|
196 |
session_id = getattr(request.cookies, 'access-token')
|
197 |
+
# logger.flag(['', x, session_id, str(datetime.now())])
|
198 |
|
199 |
back_to_top_btn_html = '''
|
200 |
<button id="toTopBtn" onclick="'parentIFrame' in window ? window.parentIFrame.scrollTo({top: 0, behavior:'smooth'}) : window.scrollTo({ top: 0 })">
|
|
|
268 |
}
|
269 |
'''
|
270 |
|
271 |
+
with gr.Blocks(css=style
|
272 |
+
# js = logging_js
|
273 |
+
) as app:
|
274 |
with gr.Row():
|
275 |
with gr.Column(min_width = 10):
|
276 |
with gr.Row():
|
|
|
325 |
if q is None:
|
326 |
q = ''
|
327 |
|
328 |
+
# logger.flag([url, q, request.cookies['access-token'], str(datetime.now())])
|
329 |
return {"message": "ok"}
|
330 |
|
331 |
# mount Gradio app to FastAPI app
|