Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Dec 13, 2024
1 parent 5edf937 commit 8a14793
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions weave/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""The top-level functions and classes for working with Weave."""

from typing import Any

from weave import version
from weave.trace.api import *

Expand All @@ -18,6 +20,18 @@
ThreadPoolExecutor, # noqa: F401
)


def __getattr__(name: str) -> Any:
"""This function defines module-level lazy imports.
The scorer module is particularly heavy, so we defer to speed up weave import."""
if name == "Scorer":
from weave.flow.scorer import Scorer

return Scorer
raise AttributeError(f"module {__name__} has no attribute {name}")


# Alias for succinct code
P = EasyPrompt

Expand Down

0 comments on commit 8a14793

Please sign in to comment.