Spaces:
Paused
Paused
Update simple_app.py
Browse files- simple_app.py +5 -9
simple_app.py
CHANGED
@@ -53,7 +53,7 @@ def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
|
53 |
if not stripped_line:
|
54 |
continue
|
55 |
|
56 |
-
# Check for a progress line
|
57 |
progress_match = progress_pattern.search(stripped_line)
|
58 |
if progress_match:
|
59 |
current = int(progress_match.group(2))
|
@@ -65,22 +65,18 @@ def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
|
65 |
gen_progress_bar.refresh()
|
66 |
continue # Skip further processing of this line
|
67 |
|
68 |
-
# Check for an INFO log line
|
69 |
info_match = info_pattern.search(stripped_line)
|
70 |
if info_match:
|
71 |
msg = info_match.group(1)
|
72 |
-
# Skip the first three INFO messages
|
73 |
if processed_steps < irrelevant_steps:
|
74 |
processed_steps += 1
|
75 |
else:
|
76 |
overall_bar.update(1)
|
77 |
percentage = (overall_bar.n / overall_bar.total) * 100
|
78 |
-
|
79 |
-
|
80 |
-
# Postfix displays the current INFO message title
|
81 |
-
overall_bar.set_postfix_str(msg)
|
82 |
-
overall_bar.refresh()
|
83 |
-
# Also print the raw log message if needed
|
84 |
tqdm.write(stripped_line)
|
85 |
else:
|
86 |
tqdm.write(stripped_line)
|
|
|
53 |
if not stripped_line:
|
54 |
continue
|
55 |
|
56 |
+
# Check for a progress line from the video generation process.
|
57 |
progress_match = progress_pattern.search(stripped_line)
|
58 |
if progress_match:
|
59 |
current = int(progress_match.group(2))
|
|
|
65 |
gen_progress_bar.refresh()
|
66 |
continue # Skip further processing of this line
|
67 |
|
68 |
+
# Check for an INFO log line.
|
69 |
info_match = info_pattern.search(stripped_line)
|
70 |
if info_match:
|
71 |
msg = info_match.group(1)
|
72 |
+
# Skip the first three INFO messages.
|
73 |
if processed_steps < irrelevant_steps:
|
74 |
processed_steps += 1
|
75 |
else:
|
76 |
overall_bar.update(1)
|
77 |
percentage = (overall_bar.n / overall_bar.total) * 100
|
78 |
+
overall_bar.set_description(f"Overall Process - {percentage:.1f}% | {msg}")
|
79 |
+
# Print the log message.
|
|
|
|
|
|
|
|
|
80 |
tqdm.write(stripped_line)
|
81 |
else:
|
82 |
tqdm.write(stripped_line)
|