implement workaround for FastAPI and discriminated unions in Body parameter

This commit is contained in:
Lincoln Stein
2023-11-11 12:22:38 -05:00
parent 2b36565e9e
commit af2264b6eb
3 changed files with 46 additions and 26 deletions

View File

@ -44,6 +44,12 @@ def example_config() -> TextualInversionConfig:
)
def test_type(store: ModelRecordServiceBase):
config = example_config()
store.add_model("key1", config)
config1 = store.get_model("key1")
assert type(config1) == TextualInversionConfig
def test_add(store: ModelRecordServiceBase):
raw = dict(
path="/tmp/foo.ckpt",