File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ pub async fn make_string_engine(
77
77
) -> pipeline_error:: Result < OpenAIChatCompletionsStreamingEngine > {
78
78
pyo3:: prepare_freethreaded_python ( ) ;
79
79
if let Ok ( venv) = env:: var ( "VIRTUAL_ENV" ) {
80
- Python :: with_gil ( |py| super :: fix_venv ( venv, py) ) ;
80
+ Python :: with_gil ( |py| {
81
+ if let Err ( e) = super :: fix_venv ( venv, py) {
82
+ tracing:: warn!( "failed to fix venv: {}" , e) ;
83
+ }
84
+ } ) ;
81
85
}
82
86
83
87
let engine = new_engine ( cancel_token, py_file, py_args) . await ?;
@@ -93,7 +97,11 @@ pub async fn make_token_engine(
93
97
) -> pipeline_error:: Result < ExecutionContext > {
94
98
pyo3:: prepare_freethreaded_python ( ) ;
95
99
if let Ok ( venv) = env:: var ( "VIRTUAL_ENV" ) {
96
- Python :: with_gil ( |py| super :: fix_venv ( venv, py) ) ;
100
+ Python :: with_gil ( |py| {
101
+ if let Err ( e) = super :: fix_venv ( venv, py) {
102
+ tracing:: warn!( "failed to fix venv: {}" , e) ;
103
+ }
104
+ } ) ;
97
105
}
98
106
99
107
let engine = new_engine ( cancel_token, py_file, py_args) . await ?;
You can’t perform that action at this time.
0 commit comments