Skip to content

Commit

Permalink
use nest_asyncio to ensure tlm can be run from jupyter notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansingman committed Jan 19, 2024
1 parent 17fd315 commit 57fd667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cleanlab_studio/studio/trustworthy_language_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Coroutine, cast, List, Literal, Optional, TypedDict, Union

import aiohttp
import nest_asyncio

from cleanlab_studio.internal.api import api
from cleanlab_studio.internal.types import JSONDict
Expand Down Expand Up @@ -68,6 +69,7 @@ def __init__(

self._quality_preset = quality_preset

nest_asyncio.apply()
self._event_loop = asyncio.get_event_loop()
self._query_semaphore = asyncio.Semaphore(max_concurrent_requests)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"aiohttp>=3.8.1",
"Click>=8.1.0,<=8.1.3",
"colorama>=0.4.4",
"pandas==2.*",
"nest_asyncio>=1.5.0" "pandas==2.*",
"pyexcel>=0.7.0",
"pyexcel-xls>=0.7.0",
"pyexcel-xlsx>=0.6.0",
Expand Down

0 comments on commit 57fd667

Please sign in to comment.