Commit aa21a03b authored by zhaohaidao's avatar zhaohaidao Committed by GitHub
Browse files

chore: add warn log when fix_venv failed (#338)

parent 9242cfa0
...@@ -77,7 +77,11 @@ pub async fn make_string_engine( ...@@ -77,7 +77,11 @@ pub async fn make_string_engine(
) -> pipeline_error::Result<OpenAIChatCompletionsStreamingEngine> { ) -> pipeline_error::Result<OpenAIChatCompletionsStreamingEngine> {
pyo3::prepare_freethreaded_python(); pyo3::prepare_freethreaded_python();
if let Ok(venv) = env::var("VIRTUAL_ENV") { if let Ok(venv) = env::var("VIRTUAL_ENV") {
Python::with_gil(|py| super::fix_venv(venv, py)); Python::with_gil(|py| {
if let Err(e) = super::fix_venv(venv, py) {
tracing::warn!("failed to fix venv: {}", e);
}
});
} }
let engine = new_engine(cancel_token, py_file, py_args).await?; let engine = new_engine(cancel_token, py_file, py_args).await?;
...@@ -93,7 +97,11 @@ pub async fn make_token_engine( ...@@ -93,7 +97,11 @@ pub async fn make_token_engine(
) -> pipeline_error::Result<ExecutionContext> { ) -> pipeline_error::Result<ExecutionContext> {
pyo3::prepare_freethreaded_python(); pyo3::prepare_freethreaded_python();
if let Ok(venv) = env::var("VIRTUAL_ENV") { if let Ok(venv) = env::var("VIRTUAL_ENV") {
Python::with_gil(|py| super::fix_venv(venv, py)); Python::with_gil(|py| {
if let Err(e) = super::fix_venv(venv, py) {
tracing::warn!("failed to fix venv: {}", e);
}
});
} }
let engine = new_engine(cancel_token, py_file, py_args).await?; let engine = new_engine(cancel_token, py_file, py_args).await?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment