-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
120ecb5
commit de00184
Showing
5 changed files
with
136 additions
and
96 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
api/core/model_runtime/model_providers/replicate/_common.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from replicate.exceptions import ReplicateError, ModelError | ||
|
||
from core.model_runtime.errors.invoke import InvokeBadRequestError, InvokeError | ||
|
||
|
||
class _CommonReplicate: | ||
|
||
@property | ||
def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]: | ||
return { | ||
InvokeBadRequestError: [ | ||
ReplicateError, | ||
ModelError | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,4 +116,4 @@ def test_get_num_tokens(): | |
] | ||
) | ||
|
||
assert num_tokens == 0 | ||
assert num_tokens == 14 |
Oops, something went wrong.