nlp-recipes icon indicating copy to clipboard operation
nlp-recipes copied to clipboard

[ASK] Should we add code in notebook "entailment_xnli_bert_azureml" to write the details of the workspace to a configuration file to the notebook library?

Open kehuangms opened this issue 5 years ago • 0 comments

Description

When running the notebook, there is a step to get or create a AML workspace:

ws = get_or_create_workspace(
    config_path=config_path,
    subscription_id=subscription_id,
    resource_group=resource_group,
    workspace_name=workspace_name,
    workspace_region=workspace_region,
)

By default there is not details of workspace (no config.json). And the code complains that it cannot find the config.json file. If I already have a created AML workspace (I have all needed parameter values for this function call), the only thing I need to do is to get that config.json.

Other Comments

Here is a simple workaround to this issue, we just need to add the following code snippet before the get_or_create_workspace function call, then we should be able to generate the config.json file.

from azureml.core import Workspace

try:
    ws = Workspace(subscription_id = subscription_id,
                  resource_group = resource_group,
                  workspace_name = workspace_name)

    # write the details of the workspace to a configuration file to the notebook library
    ws.write_config()
    print("Workspace configuration succeeded. Skip the workspace creation steps below")
except:
    print("Workspace not accessible. Change your parameters or create a new workspace below")

This only need to be done once.

kehuangms avatar Aug 23 '19 14:08 kehuangms