Skip to content

Commit 4a286c5

Browse files
committed
fix(sglang): sglang requires nest_asyncio patch
1 parent 4033442 commit 4a286c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mellea/backends/sglang.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from collections.abc import Callable
1818
from typing import TYPE_CHECKING, Any, Optional
1919

20+
import nest_asyncio
2021
import sglang as sgl # type:ignore
2122
from sglang.utils import async_stream_and_merge # type:ignore
2223
from transformers import AutoTokenizer, PreTrainedTokenizerBase
@@ -45,6 +46,8 @@
4546
from mellea.stdlib.chat import Message
4647
from mellea.stdlib.requirement import LLMaJRequirement, Requirement
4748

49+
nest_asyncio.apply()
50+
4851

4952
class LocalSGLangBackend(FormatterBackend):
5053
"""The LocalSGLangBackend uses SGLang's python offline inference interface, and uses a Formatter to convert `Component`s into prompts.

0 commit comments

Comments
 (0)