Skip to content

Commit

Permalink
fix: bump cerebras version
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleomk committed Nov 14, 2024
1 parent ebbf754 commit 802a34a
Show file tree
Hide file tree
Showing 4 changed files with 1,040 additions and 1,014 deletions.
5 changes: 1 addition & 4 deletions instructor/client_cerebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
def from_cerebras(
client: Cerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: Literal[False] = False,
**kwargs: Any,
) -> Instructor: ...

Expand All @@ -22,15 +21,13 @@ def from_cerebras(
def from_cerebras(
client: AsyncCerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: Literal[True] = True,
**kwargs: Any,
) -> AsyncInstructor: ...


def from_cerebras(
client: Cerebras | AsyncCerebras,
mode: instructor.Mode = instructor.Mode.CEREBRAS_TOOLS,
use_async: bool = False,
**kwargs: Any,
) -> Instructor | AsyncInstructor:
assert (
Expand All @@ -45,7 +42,7 @@ def from_cerebras(
client, (Cerebras, AsyncCerebras)
), "Client must be an instance of Cerebras or AsyncCerebras"

if use_async:
if isinstance(client, AsyncCerebras):
create = client.chat.completions.create
return AsyncInstructor(
client=client,
Expand Down
Loading

0 comments on commit 802a34a

Please sign in to comment.