Spaces:
Sleeping
Sleeping
Disable button while indexing
Browse files
app.py
CHANGED
|
@@ -34,25 +34,27 @@ def get_script_output(script_path, current_log=""):
|
|
| 34 |
|
| 35 |
def index_tdocs():
|
| 36 |
log_output = "⏳ Indexation en cours...\n"
|
| 37 |
-
|
| 38 |
-
|
|
|
|
| 39 |
log_output = log
|
| 40 |
|
| 41 |
log_output += "✅ Terminé.\n"
|
| 42 |
-
yield log_output
|
| 43 |
|
| 44 |
def index_specifications():
|
| 45 |
log_output = "⏳ Indexation en cours...\n"
|
| 46 |
-
|
| 47 |
-
|
|
|
|
| 48 |
log_output = log
|
| 49 |
|
| 50 |
-
for log in get_script_output(SCRIPT_BM25):
|
| 51 |
-
yield log
|
| 52 |
log_output = log
|
| 53 |
|
| 54 |
log_output += "✅ Terminé.\n"
|
| 55 |
-
yield log_output
|
| 56 |
|
| 57 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 58 |
gr.Markdown("# 📄 3GPP Indexer Main Menu")
|
|
|
|
| 34 |
|
| 35 |
def index_tdocs():
|
| 36 |
log_output = "⏳ Indexation en cours...\n"
|
| 37 |
+
yield gr.update(interactive=False), gr.update(interactive=False), log_output
|
| 38 |
+
for log in get_script_output(SCRIPT_DOC, log_output):
|
| 39 |
+
yield gr.update(interactive=False), gr.update(interactive=False), log
|
| 40 |
log_output = log
|
| 41 |
|
| 42 |
log_output += "✅ Terminé.\n"
|
| 43 |
+
yield gr.update(interactive=True), gr.update(interactive=True), log_output
|
| 44 |
|
| 45 |
def index_specifications():
|
| 46 |
log_output = "⏳ Indexation en cours...\n"
|
| 47 |
+
yield gr.update(interactive=False), gr.update(interactive=False), log_output
|
| 48 |
+
for log in get_script_output(SCRIPT_SPEC, log_output):
|
| 49 |
+
yield gr.update(interactive=False), gr.update(interactive=False), log
|
| 50 |
log_output = log
|
| 51 |
|
| 52 |
+
for log in get_script_output(SCRIPT_BM25, log_output):
|
| 53 |
+
yield gr.update(interactive=False), gr.update(interactive=False), log
|
| 54 |
log_output = log
|
| 55 |
|
| 56 |
log_output += "✅ Terminé.\n"
|
| 57 |
+
yield gr.update(interactive=True), gr.update(interactive=True), log_output
|
| 58 |
|
| 59 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 60 |
gr.Markdown("# 📄 3GPP Indexer Main Menu")
|