Fix function
This commit is contained in:
parent
299d644bc4
commit
7c99305afb
1 changed files with 15 additions and 10 deletions
|
|
@ -1,7 +1,8 @@
|
|||
from datetime import datetime
|
||||
from math import ceil
|
||||
from random import shuffle
|
||||
from typing import Any, Iterable, List, TypeVar
|
||||
from typing import Any, Iterable, List, TypeVar, cast
|
||||
from uuid import uuid4
|
||||
|
||||
from ..constants import (
|
||||
GROUND_TRUTH_TAG_NAME,
|
||||
|
|
@ -51,7 +52,10 @@ def add_ground_truth(
|
|||
|
||||
created = datetime.utcnow().isoformat()
|
||||
traces = [
|
||||
Trace[T](
|
||||
cast(
|
||||
Trace[T],
|
||||
Trace( # avoid ValueError: "Trace" object has no field "__orig_class__"
|
||||
trace_id=str(uuid4()),
|
||||
created=created,
|
||||
original_execution_time_ms=0,
|
||||
logged_values=X if isinstance(X, dict) else {"input": X},
|
||||
|
|
@ -60,6 +64,7 @@ def add_ground_truth(
|
|||
feedback=y,
|
||||
exception=None,
|
||||
tags=[GROUND_TRUTH_TAG_NAME, split_tag, *tags],
|
||||
),
|
||||
)
|
||||
for ((X, y), split_tag) in zip(values, split_tags)
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue