Skip to content

Commit e9c6dc6

Browse files
authored
Merge pull request #74 from davidthomas426/config_json_open_readonly
When inferring task, open config.json for reading only.
2 parents 62551db + d137b21 commit e9c6dc6

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.github/workflows/integ-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Set up Python 3.6
13+
- name: Set up Python 3.7
1414
uses: actions/setup-python@v2
1515
with:
16-
python-version: 3.6
16+
python-version: 3.7
1717
- name: Install Python dependencies
1818
run: pip install -e .[test,dev]
1919
- name: Run Integration Tests

.github/workflows/quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10-
- name: Set up Python 3.6
10+
- name: Set up Python 3.7
1111
uses: actions/setup-python@v2
1212
with:
13-
python-version: 3.6
13+
python-version: 3.7
1414
- name: Install Python dependencies
1515
run: pip install -e .[quality]
1616
- name: Run Quality check

.github/workflows/unit-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10-
- name: Set up Python 3.6
10+
- name: Set up Python 3.7
1111
uses: actions/setup-python@v2
1212
with:
13-
python-version: 3.6
13+
python-version: 3.7
1414
- name: Install Python dependencies
1515
run: pip install -e .[test,dev]
1616
- name: Run Unit Tests

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858

5959
# framework specific dependencies
6060
extras["torch"] = ["torch>=1.8.0", "torchaudio"]
61-
extras["tensorflow"] = ["tensorflow>=2.4.0"]
61+
62+
# TODO: Remove upper bound of TF 2.11 once transformers release contains this fix: https://github.com/huggingface/evaluate/pull/372
63+
extras["tensorflow"] = ["tensorflow>=2.4.0,<2.11"]
6264

6365
# MMS Server dependencies
6466
extras["mms"] = ["multi-model-server>=1.1.4", "retrying"]

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)