Skip to content

Commit fba8747

Browse files
bmehta001Copilot
andcommitted
Simplify Python EP progress callback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6563062 commit fba8747

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sdk/python/src/foundry_local_manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ def download_and_register_eps(
124124
request = InteropRequest(params={"Names": ",".join(names)})
125125

126126
if progress_callback is not None or cancel_event is not None:
127-
user_cb = progress_callback
128-
129127
def _on_chunk(chunk: str) -> None:
130-
if user_cb is not None:
128+
if progress_callback is not None:
131129
sep = chunk.find("|")
132130
if sep >= 0:
133131
ep_name = chunk[:sep] or ""
134132
try:
135133
percent = float(chunk[sep + 1:])
136-
user_cb(ep_name, percent)
134+
progress_callback(ep_name, percent)
137135
except ValueError:
138136
pass
139137

0 commit comments

Comments
 (0)