-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for additional tasks via HuggingFace TaskManager #113
Conversation
src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimum tasks are not 100% related to Transformers tasks.
511e150
to
3a17af2
Compare
ad170f1
to
2689eb4
Compare
src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
Outdated
Show resolved
Hide resolved
src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
Outdated
Show resolved
Hide resolved
9021f08
to
58ac9f1
Compare
6a43011
to
d6a9584
Compare
if "HF_TASK" in os.environ: | ||
return os.environ["HF_TASK"] | ||
else: | ||
with open(model_config_path, "r") as config_file: | ||
config = json.loads(config_file.read()) | ||
architecture = config.get("architectures", [None])[architecture_index] | ||
|
||
for arch_options in ARCHITECTURES_2_TASK: | ||
if architecture.endswith(arch_options): | ||
task = ARCHITECTURES_2_TASK[arch_options] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change it is the exact same code as before, but you removed the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry Sam, I missed it. https://github.com/aws/sagemaker-huggingface-inference-toolkit/blame/80634b30703e8e9525db8b7128b05f713f42f9dc/src/sagemaker_huggingface_inference_toolkit/handler_service.py#L114 looks like the HF_TASK gets checked first before this function is even called.
Not sure why HF_TASK is being checked in this function then? Don't think we need to do anything. My bad
Please double check if i missed anything again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep makes sense, I will close this issue.
Issue #, if available:
#112
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.