Skip to content

Commit

Permalink
[formrecognizer] add copy tests for new features in v2.1 (#14987)
Browse files Browse the repository at this point in the history
* add copy tests for new features in v2.1

* rerecord test

* test that submodels are the same and fix get custom model for composed model
  • Loading branch information
kristapratico authored Nov 4, 2020
1 parent c4713e3 commit c57116a
Show file tree
Hide file tree
Showing 10 changed files with 2,348 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ def get_custom_model(self, model_id, **kwargs):
raise ValueError("model_id cannot be None or empty.")

response = self._client.get_custom_model(model_id=model_id, include_keys=True, **kwargs)
if hasattr(response, "composed_train_results") and response.composed_train_results:
return CustomFormModel._from_generated_composed(response)
return CustomFormModel._from_generated(response, api_version=self.api_version)

@distributed_trace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ async def get_custom_model(self, model_id: str, **kwargs: Any) -> CustomFormMode
response = await self._client.get_custom_model(
model_id=model_id, include_keys=True, **kwargs
)
if hasattr(response, "composed_train_results") and response.composed_train_results:
return CustomFormModel._from_generated_composed(response)
return CustomFormModel._from_generated(response, api_version=self.api_version)

@distributed_trace_async
Expand Down
Loading

0 comments on commit c57116a

Please sign in to comment.