-
Notifications
You must be signed in to change notification settings - Fork 63
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
d00204f
commit 917a4a8
Showing
8 changed files
with
182 additions
and
93 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from enum import Enum | ||
from typing import Union | ||
from os import PathLike | ||
import json | ||
|
||
|
||
class Modality(Enum): | ||
TEXT_ENCODER = "text_encoder" | ||
IMAGE_ENCODER = "image_encoder" | ||
VIDEO_ENCODER = "video_encoder" | ||
TEXT_DECODER = "text_decoder" | ||
|
||
|
||
class ExecutionProviderError(Exception): | ||
"""Exception raised when a requested execution provider is not available.""" | ||
|
||
|
||
ConfigOrPath = Union[PathLike, str, object] | ||
|
||
|
||
def read_config(path_or_object: ConfigOrPath) -> object: | ||
if isinstance(path_or_object, (PathLike, str)): | ||
with open(path_or_object, "r") as f: | ||
return json.load(f) | ||
else: | ||
return path_or_object |
Oops, something went wrong.