Spaces:
Running
Running
Commit
·
ba025b4
1
Parent(s):
fad8b99
Allow to update debug info
Browse files- app_debug.py +15 -6
app_debug.py
CHANGED
|
@@ -2,6 +2,7 @@ from os import listdir
|
|
| 2 |
from os.path import isfile, join
|
| 3 |
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
import pipe
|
| 6 |
from io_utils import get_logs_file
|
| 7 |
|
|
@@ -11,7 +12,7 @@ MAX_FILES_NUM = 20
|
|
| 11 |
|
| 12 |
|
| 13 |
def get_accordions_of_files(path, files):
|
| 14 |
-
components = [None for _ in range
|
| 15 |
for i in range(0, len(files)):
|
| 16 |
if i >= MAX_FILES_NUM:
|
| 17 |
break
|
|
@@ -35,17 +36,25 @@ def get_accordions_of_config_files():
|
|
| 35 |
]
|
| 36 |
return get_accordions_of_files(CONFIG_PATH, config_files)
|
| 37 |
|
|
|
|
| 38 |
def get_config_files():
|
| 39 |
-
config_files = [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
return config_files
|
| 41 |
|
|
|
|
| 42 |
def get_demo(demo):
|
| 43 |
with gr.Row():
|
| 44 |
# check if jobs is an attribute of pipe
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
with gr.Accordion(label="Log Files", open=False):
|
| 50 |
logs = gr.Textbox(lines=10, visible=True, label="Log File")
|
| 51 |
demo.load(get_logs_file, None, logs, every=0.5)
|
|
|
|
| 2 |
from os.path import isfile, join
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
+
|
| 6 |
import pipe
|
| 7 |
from io_utils import get_logs_file
|
| 8 |
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def get_accordions_of_files(path, files):
|
| 15 |
+
components = [None for _ in range(0, MAX_FILES_NUM)]
|
| 16 |
for i in range(0, len(files)):
|
| 17 |
if i >= MAX_FILES_NUM:
|
| 18 |
break
|
|
|
|
| 36 |
]
|
| 37 |
return get_accordions_of_files(CONFIG_PATH, config_files)
|
| 38 |
|
| 39 |
+
|
| 40 |
def get_config_files():
|
| 41 |
+
config_files = [
|
| 42 |
+
join(CONFIG_PATH, f)
|
| 43 |
+
for f in listdir(CONFIG_PATH)
|
| 44 |
+
if isfile(join(CONFIG_PATH, f)) and f.endswith(".yaml")
|
| 45 |
+
]
|
| 46 |
return config_files
|
| 47 |
|
| 48 |
+
|
| 49 |
def get_demo(demo):
|
| 50 |
with gr.Row():
|
| 51 |
# check if jobs is an attribute of pipe
|
| 52 |
+
gr.Markdown(
|
| 53 |
+
lambda: f"Current job: {pipe.current} Jobs in queue: {len(pipe.jobs)}"
|
| 54 |
+
if hasattr(pipe, "jobs") and len(pipe.jobs) > 0
|
| 55 |
+
else "No jobs in queue, please submit an evaluation task.",
|
| 56 |
+
every=5,
|
| 57 |
+
)
|
| 58 |
with gr.Accordion(label="Log Files", open=False):
|
| 59 |
logs = gr.Textbox(lines=10, visible=True, label="Log File")
|
| 60 |
demo.load(get_logs_file, None, logs, every=0.5)
|