-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make use_training_labels positional required #11529
Changes from all commits
879dba0
1467808
1882b42
514a217
1b1fa68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,15 @@ class TestTrainingAsync(AsyncFormRecognizerTest): | |
async def test_training_auth_bad_key(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): | ||
client = FormTrainingClient(form_recognizer_account, AzureKeyCredential("xxxx")) | ||
with self.assertRaises(ClientAuthenticationError): | ||
result = await client.train_model("xx") | ||
result = await client.train_model("xx", use_training_labels=False) | ||
|
||
@GlobalFormRecognizerAccountPreparer() | ||
@GlobalTrainingAccountPreparer() | ||
async def test_training(self, client, container_sas_url): | ||
|
||
model = await client.train_model(training_files_url=container_sas_url) | ||
model = await client.train_model( | ||
training_files_url=container_sas_url, | ||
use_training_labels=False) | ||
|
||
self.assertIsNotNone(model.model_id) | ||
self.assertIsNotNone(model.created_on) | ||
|
@@ -51,7 +53,7 @@ async def test_training(self, client, container_sas_url): | |
@GlobalTrainingAccountPreparer(multipage=True) | ||
async def test_training_multipage(self, client, container_sas_url): | ||
|
||
model = await client.train_model(container_sas_url) | ||
model = await client.train_model(container_sas_url, use_training_labels=False) | ||
|
||
self.assertIsNotNone(model.model_id) | ||
self.assertIsNotNone(model.created_on) | ||
|
@@ -81,7 +83,10 @@ def callback(response): | |
raw_response.append(raw_model) | ||
raw_response.append(custom_model) | ||
|
||
model = await client.train_model(training_files_url=container_sas_url, cls=callback) | ||
model = await client.train_model( | ||
training_files_url=container_sas_url, | ||
use_training_labels=False, | ||
cls=callback) | ||
|
||
raw_model = raw_response[0] | ||
custom_model = raw_response[1] | ||
|
@@ -99,7 +104,7 @@ def callback(response): | |
raw_response.append(raw_model) | ||
raw_response.append(custom_model) | ||
|
||
model = await client.train_model(container_sas_url, cls=callback) | ||
model = await client.train_model(container_sas_url, use_training_labels=False, cls=callback) | ||
|
||
raw_model = raw_response[0] | ||
custom_model = raw_response[1] | ||
|
@@ -189,13 +194,13 @@ def callback(response): | |
@GlobalTrainingAccountPreparer() | ||
async def test_training_with_files_filter(self, client, container_sas_url): | ||
|
||
model = await client.train_model(training_files_url=container_sas_url, include_sub_folders=True) | ||
model = await client.train_model(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True) | ||
self.assertEqual(len(model.training_documents), 6) | ||
self.assertEqual(model.training_documents[-1].document_name, "subfolder/Form_6.jpg") # we traversed subfolders | ||
|
||
model = await client.train_model(container_sas_url, prefix="subfolder", include_sub_folders=True) | ||
model = await client.train_model(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True) | ||
self.assertEqual(len(model.training_documents), 1) | ||
self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders | ||
|
||
with self.assertRaises(HttpResponseError): | ||
model = await client.train_model(training_files_url=container_sas_url, prefix="xxx") | ||
model = await client.train_model(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you update sample_train_model_without_labels (the sync and async)? they don't have Can you also run the samples that call train_model (or begin_train_model), just to make 100% sure they pass with this new change? thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we missing tests that use training labels ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have the tests - just didnt need to update them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the changelog?