Skip to content

Commit 42370b3

Browse files
authored
Merge pull request #654 from basetenlabs/bump-version-0.7.4
Release 0.7.4
2 parents 9211c06 + ee3d658 commit 42370b3

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "truss"
3-
version = "0.7.3"
3+
version = "0.7.4"
44
description = "A seamless bridge from model development to model delivery"
55
license = "MIT"
66
readme = "README.md"

truss/tests/test_config.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import tempfile
12
from pathlib import Path
23

34
import pytest
@@ -205,6 +206,14 @@ def test_non_default_train():
205206
assert new_config == config.to_dict(verbose=False)
206207

207208

209+
def test_null_hf_cache_key():
210+
config_yaml_dict = {"hf_cache": None}
211+
with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp_file:
212+
yaml.safe_dump(config_yaml_dict, tmp_file)
213+
config = TrussConfig.from_yaml(Path(tmp_file.name))
214+
assert config.hf_cache == HuggingFaceCache.from_list([])
215+
216+
208217
def test_huggingface_cache_single_model_default_revision():
209218
config = TrussConfig(
210219
python_version="py39",

truss/truss_config.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,10 @@ def from_dict(d):
489489
d.get("external_data"), ExternalData.from_list
490490
),
491491
base_image=transform_optional(d.get("base_image"), BaseImage.from_dict),
492-
hf_cache=HuggingFaceCache.from_list(d.get("hf_cache", [])),
492+
hf_cache=transform_optional(
493+
d.get("hf_cache") or [],
494+
HuggingFaceCache.from_list,
495+
),
493496
)
494497
config.validate()
495498
return config

0 commit comments

Comments
 (0)