Fix router gRPC mode launch error caused by async loading (#15368)
This commit is contained in:
@@ -33,8 +33,10 @@ static HARMONY_ENCODING: OnceLock<HarmonyEncoding> = OnceLock::new();
|
|||||||
/// Uses HarmonyGptOss encoding which supports the gpt-oss model family.
|
/// Uses HarmonyGptOss encoding which supports the gpt-oss model family.
|
||||||
pub(super) fn get_harmony_encoding() -> &'static HarmonyEncoding {
|
pub(super) fn get_harmony_encoding() -> &'static HarmonyEncoding {
|
||||||
HARMONY_ENCODING.get_or_init(|| {
|
HARMONY_ENCODING.get_or_init(|| {
|
||||||
openai_harmony::load_harmony_encoding(HarmonyEncodingName::HarmonyGptOss)
|
tokio::task::block_in_place(|| {
|
||||||
.expect("Failed to load Harmony encoding")
|
openai_harmony::load_harmony_encoding(HarmonyEncodingName::HarmonyGptOss)
|
||||||
|
.expect("Failed to load Harmony encoding")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user