Unverified Commit 4d2e3051 authored by mlmz's avatar mlmz Committed by GitHub
Browse files

doc: nested loop code for offline engine (#5244)

parent e53a0b3d
...@@ -22,6 +22,20 @@ ...@@ -22,6 +22,20 @@
"\n" "\n"
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Nest Asyncio\n",
"Note that if you want to use **Offline Engine** in ipython or some other nested loop code, you need to add the following code:\n",
"```python\n",
"import nest_asyncio\n",
"\n",
"nest_asyncio.apply()\n",
"\n",
"```"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
...@@ -63,6 +77,10 @@ ...@@ -63,6 +77,10 @@
"\n", "\n",
"if is_in_ci():\n", "if is_in_ci():\n",
" import patch\n", " import patch\n",
"else:\n",
" import nest_asyncio\n",
"\n",
" nest_asyncio.apply()\n",
"\n", "\n",
"\n", "\n",
"llm = sgl.Engine(model_path=\"meta-llama/Meta-Llama-3.1-8B-Instruct\")" "llm = sgl.Engine(model_path=\"meta-llama/Meta-Llama-3.1-8B-Instruct\")"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment