Skip to content

Commit 9b1cae6

Browse files
committed
fix(sglang): sglang requires nest_asyncio patch
1 parent 1bc6efd commit 9b1cae6

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
@@ -15,6 +15,7 @@
1515
from collections.abc import Callable
1616
from typing import TYPE_CHECKING, Any, Optional
1717

18+
import nest_asyncio
1819
import sglang as sgl # type:ignore
1920
import torch
2021
from transformers import AutoTokenizer, PreTrainedTokenizerBase
@@ -41,6 +42,8 @@
4142
from mellea.stdlib.chat import Message
4243
from mellea.stdlib.requirement import LLMaJRequirement, Requirement
4344

45+
nest_asyncio.apply()
46+
4447

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

0 commit comments

Comments
 (0)