File tree Expand file tree Collapse file tree 3 files changed +18
-15
lines changed
langchain-integration/src Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 1212manager = FoundryLocalManager .instance
1313
1414# Download and register all execution providers.
15- _current_ep = [ "" ]
15+ current_ep = ""
1616def _ep_progress (ep_name : str , percent : float ):
17- if ep_name != _current_ep [0 ]:
18- if _current_ep [0 ]:
17+ global current_ep
18+ if ep_name != current_ep :
19+ if current_ep :
1920 print ()
20- _current_ep [ 0 ] = ep_name
21+ current_ep = ep_name
2122 print (f"\r { ep_name :<30} { percent :5.1f} %" , end = "" , flush = True )
2223
2324manager .download_and_register_eps (progress_callback = _ep_progress )
24- if _current_ep [ 0 ] :
25+ if current_ep :
2526 print ()
2627
2728# Load the whisper model for speech-to-text
Original file line number Diff line number Diff line change 1313manager = FoundryLocalManager .instance
1414
1515# Download and register all execution providers.
16- _current_ep = [ "" ]
16+ current_ep = ""
1717def _ep_progress (ep_name : str , percent : float ):
18- if ep_name != _current_ep [0 ]:
19- if _current_ep [0 ]:
18+ global current_ep
19+ if ep_name != current_ep :
20+ if current_ep :
2021 print ()
21- _current_ep [ 0 ] = ep_name
22+ current_ep = ep_name
2223 print (f"\r { ep_name :<30} { percent :5.1f} %" , end = "" , flush = True )
2324
2425manager .download_and_register_eps (progress_callback = _ep_progress )
25- if _current_ep [ 0 ] :
26+ if current_ep :
2627 print ()
2728
2829# Load a model
Original file line number Diff line number Diff line change 1111manager = FoundryLocalManager .instance
1212
1313# Download and register all execution providers.
14- _current_ep = [ "" ]
14+ current_ep = ""
1515def _ep_progress (ep_name : str , percent : float ):
16- if ep_name != _current_ep [0 ]:
17- if _current_ep [0 ]:
16+ global current_ep
17+ if ep_name != current_ep :
18+ if current_ep :
1819 print ()
19- _current_ep [ 0 ] = ep_name
20+ current_ep = ep_name
2021 print (f"\r { ep_name :<30} { percent :5.1f} %" , end = "" , flush = True )
2122
2223manager .download_and_register_eps (progress_callback = _ep_progress )
23- if _current_ep [ 0 ] :
24+ if current_ep :
2425 print ()
2526
2627# Load a model
You can’t perform that action at this time.
0 commit comments