doc: nested loop code for offline engine (#5244)
This commit is contained in:
@@ -22,6 +22,20 @@
|
||||
"\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",
|
||||
"metadata": {},
|
||||
@@ -63,6 +77,10 @@
|
||||
"\n",
|
||||
"if is_in_ci():\n",
|
||||
" import patch\n",
|
||||
"else:\n",
|
||||
" import nest_asyncio\n",
|
||||
"\n",
|
||||
" nest_asyncio.apply()\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"llm = sgl.Engine(model_path=\"meta-llama/Meta-Llama-3.1-8B-Instruct\")"
|
||||
|
||||
Reference in New Issue
Block a user