Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
aa21a03b
Commit
aa21a03b
authored
Mar 22, 2025
by
zhaohaidao
Committed by
GitHub
Mar 21, 2025
Browse files
chore: add warn log when fix_venv failed (#338)
parent
9242cfa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lib/llm/src/engines/python.rs
lib/llm/src/engines/python.rs
+10
-2
No files found.
lib/llm/src/engines/python.rs
View file @
aa21a03b
...
@@ -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
?
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment