<jupyter_start><jupyter_text>Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.  Use Azure Percept MM Python SDK in Jupyter Notebook

Before Azure Percept MM Python SDK is formally published, you need to install it from a local wheel file, which can be found under the same folder where this workbook resides.<jupyter_code>import sys

!$sys.executable -m pip uninstall -y sczpy
!$sys.executable -m pip install sczpy<jupyter_output><empty_output><jupyter_text>Then, you need to declare a few environment variables that defines the Azure Service Principal to be used for authentication. If you've used the PowerShell script to provision your Azure Percept MM server, you should use the same service principal provisioned by the script.<jupyter_code>%env AZURE_CLIENT_ID=
%env AZURE_CLIENT_SECRET=
%env AZURE_TENANT_ID=<jupyter_output><empty_output><jupyter_text>Next, create a new Azure Percept MM client using your Azure Percept MM server URL<jupyter_code>import sczpy
server_url=
client = sczpy.SCZClient(server_url)<jupyter_output><empty_output><jupyter_text>An AI model version needs to be registered with the Azure Percept MM server:<jupyter_code>model_name = "my-model"
model_version = "v1"
client.register_model(model_name, model_version)
client.encrypt(model_name, model_version, "model.txt", "model.txt.enc")
client.decrypt(model_name, model_version, "model.txt.enc", "model.decrypted.txt")
client.upload_model(model_name, model_version, "model.txt.enc")
client.download_model(model_name, model_version, "downloaded.txt.enc")
client.decrypt(model_name, model_version, "downloaded.txt.enc", "downloaded.decrypted.txt")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08152492668621701, 'fraction_numerical': 0.0005865102639296188, 'mean_word_length': 6.825688073394495, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '16401', 'license': 'MIT', 'n_tokens_mistral': 544, 'n_tokens_neox': 536, 'n_words': 166, 'path': 'secured_locker/jupyter-basics/sczpy-basics.ipynb', 'repo_name': 'c-tsai/azure-percept-advanced-development', 'size': '1705'}