Spaces:
Sleeping
Sleeping
removed dataframe output and hide to be used as tool in huggingchat
Browse files
app.py
CHANGED
@@ -329,7 +329,7 @@ def ChatFunc(message, history, LangMode, ChooseLang):
|
|
329 |
finally:
|
330 |
yield m.done()
|
331 |
|
332 |
-
def SearchFiles(message
|
333 |
|
334 |
Question = message;
|
335 |
|
@@ -363,13 +363,10 @@ def SearchFiles(message, JsonOnly = False):
|
|
363 |
|
364 |
RankedScripts = sorted(FoundScripts, key=lambda item: float(item['rank']), reverse=True)
|
365 |
|
366 |
-
result = pd.DataFrame(ScriptTable)
|
367 |
-
jsonresult =
|
368 |
-
if JsonOnly:
|
369 |
-
result = None;
|
370 |
-
jsonresult = json.dumps(RankedScripts)
|
371 |
|
372 |
-
return
|
373 |
|
374 |
resultTable = gr.Dataframe(datatype = ['html','number','number'], interactive = False, show_search = "search");
|
375 |
TextResults = gr.Textbox()
|
@@ -408,12 +405,12 @@ with gr.Blocks(fill_height=True) as demo:
|
|
408 |
|
409 |
|
410 |
with gr.Tab("Rank"):
|
411 |
-
txtSearchTable = gr.Textbox(label="Search script files",info="Description of what you want")
|
412 |
AsJson = gr.Checkbox(visible = False)
|
413 |
resultTable.render();
|
414 |
|
415 |
|
416 |
-
txtSearchTable.submit(SearchFiles, [txtSearchTable
|
417 |
|
418 |
with gr.Tab("Help"):
|
419 |
gr.Markdown("""
|
|
|
329 |
finally:
|
330 |
yield m.done()
|
331 |
|
332 |
+
def SearchFiles(message):
|
333 |
|
334 |
Question = message;
|
335 |
|
|
|
363 |
|
364 |
RankedScripts = sorted(FoundScripts, key=lambda item: float(item['rank']), reverse=True)
|
365 |
|
366 |
+
#result = pd.DataFrame(ScriptTable)
|
367 |
+
jsonresult = json.dumps(RankedScripts)
|
|
|
|
|
|
|
368 |
|
369 |
+
return jsonresult;
|
370 |
|
371 |
resultTable = gr.Dataframe(datatype = ['html','number','number'], interactive = False, show_search = "search");
|
372 |
TextResults = gr.Textbox()
|
|
|
405 |
|
406 |
|
407 |
with gr.Tab("Rank"):
|
408 |
+
txtSearchTable = gr.Textbox(label="Search script files",info="Description of what you want", visible = False)
|
409 |
AsJson = gr.Checkbox(visible = False)
|
410 |
resultTable.render();
|
411 |
|
412 |
|
413 |
+
txtSearchTable.submit(SearchFiles, [txtSearchTable],[TextResults])
|
414 |
|
415 |
with gr.Tab("Help"):
|
416 |
gr.Markdown("""
|