Spaces:
Running
Running
fix async
Browse files
tasks.py
CHANGED
@@ -150,9 +150,11 @@ class Task:
|
|
150 |
@cached_property
|
151 |
def result(self) -> dict:
|
152 |
assert self.outputs, "Please run the task first."
|
153 |
-
|
154 |
responses=self.outputs, references=self.dataset[self.label_column]
|
155 |
)
|
|
|
|
|
156 |
|
157 |
# @cache
|
158 |
def run(
|
|
|
150 |
@cached_property
|
151 |
def result(self) -> dict:
|
152 |
assert self.outputs, "Please run the task first."
|
153 |
+
results = self.metric._compute(
|
154 |
responses=self.outputs, references=self.dataset[self.label_column]
|
155 |
)
|
156 |
+
logging.info(f"{self.name}:{results}")
|
157 |
+
return results
|
158 |
|
159 |
# @cache
|
160 |
def run(
|
tlem.py
CHANGED
@@ -108,7 +108,7 @@ class Suite(EvaluationSuite):
|
|
108 |
def arun(self, model_or_pipeline):
|
109 |
async def sync_function():
|
110 |
return await tqdm.gather(
|
111 |
-
*[task.
|
112 |
)
|
113 |
|
114 |
asyncio.run(sync_function())
|
|
|
108 |
def arun(self, model_or_pipeline):
|
109 |
async def sync_function():
|
110 |
return await tqdm.gather(
|
111 |
+
*[task.arun(model_or_pipeline) for task in self.tasks], leave=False
|
112 |
)
|
113 |
|
114 |
asyncio.run(sync_function())
|