-
-
Save kurianbenoy/346090c325dcf4f8f77ec3fbda3f0f99 to your computer and use it in GitHub Desktop.
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
supported = ["a", "b", "c", "en", "ta"] | |
def load_model(source, target): | |
if source == target: | |
raise ModelNotSupported("Hello how are you") | |
if source in supported: | |
if source == "en": | |
return ("t", "t") | |
else: | |
raise ModelNotSupported("Language pair not available") | |
def predict_raw(): | |
try: | |
tokenizer, model = load_model("en", "hello") | |
return model | |
except ModelNotSupported as e: | |
return {"inputerror": e} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment