mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-12 12:40:29 +08:00
Fix progress bar compatibility with generators (#9693)
* Fix progress bar compatibility with generators * add changeset * Format helpers.py * Fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
parent
31418ef388
commit
c45b46652d
5
.changeset/khaki-sites-bow.md
Normal file
5
.changeset/khaki-sites-bow.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Fix progress bar compatibility with generators
|
@ -764,7 +764,7 @@ class Progress(Iterable):
|
||||
self.iterables.append(new_iterable)
|
||||
callback(self.iterables)
|
||||
return self
|
||||
length = len(iterable) if hasattr(iterable, "__len__") else None # type: ignore
|
||||
length = len(iterable) if hasattr(iterable, "__len__") else total # type: ignore
|
||||
self.iterables.append(
|
||||
TrackedIterable(iter(iterable), 0, length, desc, unit, _tqdm)
|
||||
)
|
||||
|
@ -646,7 +646,7 @@ class Queue:
|
||||
event,
|
||||
ProcessCompletedMessage(
|
||||
output=content,
|
||||
title=content["title"], # type: ignore
|
||||
title=content.get("title", "Error"), # type: ignore
|
||||
success=False,
|
||||
),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user