-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add assistants api support Signed-off-by: Chendi.Xue <chendi.xue@intel.com> * update UT to match new port definition Signed-off-by: Chendi.Xue <chendi.xue@intel.com> * rebase Signed-off-by: Chendi.Xue <chendi.xue@intel.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix gramma in Test Signed-off-by: Chendi.Xue <chendi.xue@intel.com> --------- Signed-off-by: Chendi.Xue <chendi.xue@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5dedd04
commit f3a8935
Showing
13 changed files
with
568 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import threading | ||
|
||
|
||
class ThreadSafeDict(dict): | ||
def __init__(self, *p_arg, **n_arg): | ||
dict.__init__(self, *p_arg, **n_arg) | ||
self._lock = threading.Lock() | ||
|
||
def __enter__(self): | ||
self._lock.acquire() | ||
return self | ||
|
||
def __exit__(self, type, value, traceback): | ||
self._lock.release() | ||
|
||
|
||
assistants_global_kv = ThreadSafeDict() | ||
threads_global_kv = ThreadSafeDict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.