Skip to content

Commit 86acbaf

Browse files
committed
fixing async stuff is fun
1 parent 46dfa75 commit 86acbaf

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

stopes/pipelines/bitext/global_mining_pipeline.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,9 @@ async def _process_language_shard(
419419
return result
420420

421421
def run(self) -> tp.Tuple[Path, Path]:
422-
loop = asyncio.get_event_loop()
423422
if self.config.launcher.cluster == "debug":
424-
loop.set_debug(True)
425-
return loop.run_until_complete(self.arun())
423+
asyncio.get_event_loop().set_debug(True)
424+
return asyncio.run(self.arun())
426425

427426
async def arun(self) -> tp.Tuple[Path, Path]:
428427
"""Run the global mining pipeline and return the paths of the mined text and metadata files"""

stopes/pipelines/tests/test_global_mining.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def encode_to_np(
129129
(False, True, True, "speech"),
130130
],
131131
)
132-
# @pytest.mark.asyncio(scope="session")
132+
@pytest.mark.asyncio(scope="session")
133133
def test_global_mining_pipeline(
134134
tmp_path: Path, split_langs: bool, use_meta: bool, fp16: bool, modality: str
135135
) -> None:

0 commit comments

Comments
 (0)