Skip to content

Commit d189130

Browse files
When inferring task, open config.json for reading only.
1 parent 62551db commit d189130

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sagemaker_huggingface_inference_toolkit/transformers_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def infer_task_from_model_architecture(model_config_path: str, architecture_inde
211211
trainend on different tasks https://huggingface.co/facebook/bart-large/blob/main/config.json. Should work for every on Amazon SageMaker fine-tuned model.
212212
It is always recommended to set the task through the env var `TASK`.
213213
"""
214-
with open(model_config_path, "r+") as config_file:
214+
with open(model_config_path, "r") as config_file:
215215
config = json.loads(config_file.read())
216216
architecture = config.get("architectures", [None])[architecture_index]
217217

0 commit comments

Comments
 (0)