Skip to content

Commit

Permalink
Fallback asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Aug 10, 2023
1 parent 7871a04 commit 75aefeb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/langsmith/evaluation/evaluator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from abc import abstractmethod
from typing import Dict, Optional, Union

Expand Down Expand Up @@ -42,6 +43,6 @@ async def aevaluate_run(
self, run: Run, example: Optional[Example] = None
) -> EvaluationResult:
"""Evaluate an example asynchronously."""
raise NotImplementedError(
f"{self.__class__.__name__} does not implement aevaluate_run"
return await asyncio.get_running_loop().run_in_executor(
None, self.evaluate_run, run, example
)

0 comments on commit 75aefeb

Please sign in to comment.