From 6d5a985e1b7ea8d688c84a48fef6bbd9ae4cc308 Mon Sep 17 00:00:00 2001 From: Mathias Leys Date: Thu, 8 Aug 2024 09:40:28 +0100 Subject: [PATCH] Add UUIDs to notebook telemetry --- examples/complex_model/complex_model.ipynb | 5 +- examples/conv_net/conv_net.ipynb | 5 +- .../linear_regression/linear_regression.ipynb | 59 +++---- examples/neural_net/neural_net.ipynb | 39 ++--- examples/spam_detection/spam_detection.ipynb | 155 +++++++++--------- examples/time_series/time_series.ipynb | 39 ++--- 6 files changed, 154 insertions(+), 148 deletions(-) diff --git a/examples/complex_model/complex_model.ipynb b/examples/complex_model/complex_model.ipynb index 91a3ad3..15716b7 100644 --- a/examples/complex_model/complex_model.ipynb +++ b/examples/complex_model/complex_model.ipynb @@ -73,7 +73,8 @@ "source": [ "import os\n", "import time\n", - "import sys" + "import sys\n", + "import uuid" ] }, { @@ -151,7 +152,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-complex-model\" + my_identifier\n", + " identifier = f\"nada-ai-complex-model-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", diff --git a/examples/conv_net/conv_net.ipynb b/examples/conv_net/conv_net.ipynb index 895a426..47db481 100644 --- a/examples/conv_net/conv_net.ipynb +++ b/examples/conv_net/conv_net.ipynb @@ -97,7 +97,8 @@ "source": [ "import os\n", "import time\n", - "import sys" + "import sys\n", + "import uuid" ] }, { @@ -173,7 +174,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-conv-net\" + my_identifier\n", + " identifier = f\"nada-ai-conv-net-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", diff --git a/examples/linear_regression/linear_regression.ipynb b/examples/linear_regression/linear_regression.ipynb index b0fc8bb..ee907db 100644 --- a/examples/linear_regression/linear_regression.ipynb +++ b/examples/linear_regression/linear_regression.ipynb @@ -56,16 +56,16 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "id": "o4PXBlE2v_7K", - "outputId": "943693f2-51f8-4685-ea29-07b89b7b876a", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "o4PXBlE2v_7K", + "outputId": "943693f2-51f8-4685-ea29-07b89b7b876a" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.0/61.0 kB\u001b[0m \u001b[31m1.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.8/54.8 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", @@ -89,29 +89,30 @@ }, { "cell_type": "code", - "source": [ - "import os\n", - "import time\n", - "import sys" - ], + "execution_count": 2, "metadata": { "id": "IltP23dY9Wuq" }, - "execution_count": 2, - "outputs": [] + "outputs": [], + "source": [ + "import os\n", + "import time\n", + "import sys\n", + "import uuid" + ] }, { "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "-qsIYfic9X3T" + }, + "outputs": [], "source": [ "# Configure telemetry settings\n", "enable_telemetry = True #@param {type:\"boolean\"}\n", "my_identifier = \"your-telemetry-identifier\" #@param {type:\"string\"}" - ], - "metadata": { - "id": "-qsIYfic9X3T" - }, - "execution_count": 3, - "outputs": [] + ] }, { "cell_type": "code", @@ -125,8 +126,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", @@ -173,7 +174,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-linear-regression\" + my_identifier\n", + " identifier = f\"nada-ai-linear-regression-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", @@ -194,8 +195,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "nohup: appending output to 'nohup.out'\n" ] @@ -212,16 +213,16 @@ "cell_type": "code", "execution_count": 6, "metadata": { - "id": "4teHBr6W5_Mz", - "outputId": "977f6410-431b-4015-be80-f0278df7f058", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "4teHBr6W5_Mz", + "outputId": "977f6410-431b-4015-be80-f0278df7f058" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Cloning into 'nada-ai'...\n", "remote: Enumerating objects: 1483, done.\u001b[K\n", @@ -273,8 +274,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Building program: \u001b[1m\u001b[32mlinear_regression\u001b[39m\u001b[0m\n", "\u001b[1;32mBuild complete!\u001b[0m\n" @@ -297,8 +298,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "linear_regression.nada.bin\n" ] @@ -343,8 +344,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Running test: \u001b[1m\u001b[32mlinear_regression\u001b[39m\u001b[0m\n", "Building ...\n", @@ -390,8 +391,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Getting quote for operation...\n", "Submitting payment receipt 2 unil, tx hash C9B4C1614E43958E1174F3A8068CB8385B2A72EBD6224381CC0C4039C810D3DD\n", @@ -461,4 +462,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/examples/neural_net/neural_net.ipynb b/examples/neural_net/neural_net.ipynb index efb1590..96fb3b8 100644 --- a/examples/neural_net/neural_net.ipynb +++ b/examples/neural_net/neural_net.ipynb @@ -56,16 +56,16 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "id": "o4PXBlE2v_7K", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "o4PXBlE2v_7K", "outputId": "4b268ef1-60d7-49df-b9c1-51c4038addd1" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.0/61.0 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.8/54.8 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", @@ -97,21 +97,22 @@ "source": [ "import os\n", "import time\n", - "import sys" + "import sys\n", + "import uuid" ] }, { "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "nQVtynG6_CSG" + }, + "outputs": [], "source": [ "# Configure telemetry settings\n", "enable_telemetry = True #@param {type:\"boolean\"}\n", "my_identifier = \"your-telemetry-identifier\" #@param {type:\"string\"}" - ], - "metadata": { - "id": "nQVtynG6_CSG" - }, - "execution_count": 3, - "outputs": [] + ] }, { "cell_type": "code", @@ -125,8 +126,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", @@ -173,7 +174,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-neural-net\" + my_identifier\n", + " identifier = f\"nada-ai-neural-net-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", @@ -194,8 +195,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "nohup: appending output to 'nohup.out'\n" ] @@ -212,16 +213,16 @@ "cell_type": "code", "execution_count": 6, "metadata": { - "id": "4teHBr6W5_Mz", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "4teHBr6W5_Mz", "outputId": "44a9abf7-c3fd-4e46-ad8a-5ca9582fbef0" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Cloning into 'nada-ai'...\n", "remote: Enumerating objects: 1483, done.\u001b[K\n", @@ -273,8 +274,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Building program: \u001b[1m\u001b[32mneural_net\u001b[39m\u001b[0m\n", "\u001b[1;32mBuild complete!\u001b[0m\n" @@ -297,8 +298,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "neural_net.nada.bin\n" ] @@ -343,8 +344,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Running test: \u001b[1m\u001b[32mneural_net\u001b[39m\u001b[0m\n", "Building ...\n", @@ -390,8 +391,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Getting quote for operation...\n", "Submitting payment receipt 2 unil, tx hash BA58D92BBBC4286DCDFCB0F7D26456C1C3B86FA0EF25B02597EDD7A4D0C0F9C6\n", @@ -464,4 +465,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/examples/spam_detection/spam_detection.ipynb b/examples/spam_detection/spam_detection.ipynb index 1b688e7..7d98e3c 100644 --- a/examples/spam_detection/spam_detection.ipynb +++ b/examples/spam_detection/spam_detection.ipynb @@ -64,8 +64,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.0/61.0 kB\u001b[0m \u001b[31m998.5 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.8/54.8 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", @@ -97,21 +97,22 @@ "source": [ "import os\n", "import time\n", - "import sys" + "import sys\n", + "import uuid" ] }, { "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "jtEZDic_ASKl" + }, + "outputs": [], "source": [ "# Configure telemetry settings\n", "enable_telemetry = True #@param {type:\"boolean\"}\n", "my_identifier = \"your-telemetry-identifier\" #@param {type:\"string\"}" - ], - "metadata": { - "id": "jtEZDic_ASKl" - }, - "execution_count": 3, - "outputs": [] + ] }, { "cell_type": "code", @@ -125,8 +126,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", @@ -173,7 +174,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-spam-detection\" + my_identifier\n", + " identifier = f\"nada-ai-spam-detection-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", @@ -194,8 +195,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "nohup: appending output to 'nohup.out'\n" ] @@ -220,8 +221,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Cloning into 'nada-ai'...\n", "remote: Enumerating objects: 1483, done.\u001b[K\n", @@ -273,8 +274,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Building program: \u001b[1m\u001b[32mspam_detection\u001b[39m\u001b[0m\n", "\u001b[1;32mBuild complete!\u001b[0m\n" @@ -297,8 +298,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "spam_detection.nada.bin\n" ] @@ -343,8 +344,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Running test: \u001b[1m\u001b[32mspam_detection\u001b[39m\u001b[0m\n", "Building ...\n", @@ -402,22 +403,22 @@ "cell_type": "code", "execution_count": 10, "metadata": { - "id": "_-X12FEUL_H4", - "outputId": "eed0411a-fe5a-4bdd-bf6b-e99470ecd6ad", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "_-X12FEUL_H4", + "outputId": "eed0411a-fe5a-4bdd-bf6b-e99470ecd6ad" }, "outputs": [ { - "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, + "execution_count": 10, "metadata": {}, - "execution_count": 10 + "output_type": "execute_result" } ], "source": [ @@ -474,25 +475,21 @@ "cell_type": "code", "execution_count": 12, "metadata": { - "id": "Hb6I05y2MKDz", - "outputId": "84c14d63-08e6-467c-dbb4-75ebac904798", "colab": { "base_uri": "https://localhost:8080/", "height": 206 - } + }, + "id": "Hb6I05y2MKDz", + "outputId": "84c14d63-08e6-467c-dbb4-75ebac904798" }, "outputs": [ { - "output_type": "execute_result", "data": { - "text/plain": [ - " label message\n", - "0 ham Go until jurong point, crazy.. Available only ...\n", - "1 ham Ok lar... Joking wif u oni...\n", - "2 spam Free entry in 2 a wkly comp to win FA Cup fina...\n", - "3 ham U dun say so early hor... U c already then say...\n", - "4 ham Nah I don't think he goes to usf, he lives aro..." - ], + "application/vnd.google.colaboratory.intrinsic+json": { + "summary": "{\n \"name\": \"df\",\n \"rows\": 5572,\n \"fields\": [\n {\n \"column\": \"label\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"spam\",\n \"ham\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"message\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5169,\n \"samples\": [\n \"K, makes sense, btw carlos is being difficult so you guys are gonna smoke while I go pick up the second batch and get gas\",\n \"URGENT! Your mobile No *********** WON a \\u00a32,000 Bonus Caller Prize on 02/06/03! This is the 2nd attempt to reach YOU! Call 09066362220 ASAP! BOX97N7QP, 150ppm\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}", + "type": "dataframe", + "variable_name": "df" + }, "text/html": [ "\n", "
\n", @@ -757,14 +754,18 @@ "
\n", " \n" ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "dataframe", - "variable_name": "df", - "summary": "{\n \"name\": \"df\",\n \"rows\": 5572,\n \"fields\": [\n {\n \"column\": \"label\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"spam\",\n \"ham\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"message\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5169,\n \"samples\": [\n \"K, makes sense, btw carlos is being difficult so you guys are gonna smoke while I go pick up the second batch and get gas\",\n \"URGENT! Your mobile No *********** WON a \\u00a32,000 Bonus Caller Prize on 02/06/03! This is the 2nd attempt to reach YOU! Call 09066362220 ASAP! BOX97N7QP, 150ppm\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" - } + "text/plain": [ + " label message\n", + "0 ham Go until jurong point, crazy.. Available only ...\n", + "1 ham Ok lar... Joking wif u oni...\n", + "2 spam Free entry in 2 a wkly comp to win FA Cup fina...\n", + "3 ham U dun say so early hor... U c already then say...\n", + "4 ham Nah I don't think he goes to usf, he lives aro..." + ] }, + "execution_count": 12, "metadata": {}, - "execution_count": 12 + "output_type": "execute_result" } ], "source": [ @@ -791,22 +792,22 @@ "cell_type": "code", "execution_count": 14, "metadata": { - "id": "dYnJ4jcxMLsI", - "outputId": "9fa1532c-f133-46d0-d58c-12403a37876e", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "dYnJ4jcxMLsI", + "outputId": "9fa1532c-f133-46d0-d58c-12403a37876e" }, "outputs": [ { - "output_type": "execute_result", "data": { "text/plain": [ "['model/vectorizer.joblib']" ] }, + "execution_count": 14, "metadata": {}, - "execution_count": 14 + "output_type": "execute_result" } ], "source": [ @@ -824,20 +825,16 @@ "cell_type": "code", "execution_count": 15, "metadata": { - "id": "_wvq3gAvMLvn", - "outputId": "53ff3699-244a-42a3-c63c-b60a75f42595", "colab": { "base_uri": "https://localhost:8080/", "height": 80 - } + }, + "id": "_wvq3gAvMLvn", + "outputId": "53ff3699-244a-42a3-c63c-b60a75f42595" }, "outputs": [ { - "output_type": "execute_result", "data": { - "text/plain": [ - "LogisticRegression()" - ], "text/html": [ "
LogisticRegression()
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
" + ], + "text/plain": [ + "LogisticRegression()" ] }, + "execution_count": 15, "metadata": {}, - "execution_count": 15 + "output_type": "execute_result" } ], "source": [ @@ -1260,16 +1261,16 @@ "cell_type": "code", "execution_count": 16, "metadata": { - "id": "Lu9BidsnMN92", - "outputId": "7b49e423-51b8-4f73-9662-ec4da5665ac6", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "Lu9BidsnMN92", + "outputId": "7b49e423-51b8-4f73-9662-ec4da5665ac6" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Accuracy: 98.2053%\n" ] @@ -1289,16 +1290,16 @@ "cell_type": "code", "execution_count": 17, "metadata": { - "id": "S3EiqgPOMQCh", - "outputId": "e338e1a6-38ff-40d4-ceb9-3e2d786e0c93", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "S3EiqgPOMQCh", + "outputId": "e338e1a6-38ff-40d4-ceb9-3e2d786e0c93" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Optimal regression coefficients are: (1, 500)\n", "Optimal bias is: (1,)\n" @@ -1314,22 +1315,22 @@ "cell_type": "code", "execution_count": 18, "metadata": { - "id": "uGaedw7NMRHZ", - "outputId": "20991856-8241-400a-9fe1-3da244ed1dec", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "uGaedw7NMRHZ", + "outputId": "20991856-8241-400a-9fe1-3da244ed1dec" }, "outputs": [ { - "output_type": "execute_result", "data": { "text/plain": [ "['model/classifier.joblib']" ] }, + "execution_count": 18, "metadata": {}, - "execution_count": 18 + "output_type": "execute_result" } ], "source": [ @@ -1341,16 +1342,16 @@ "cell_type": "code", "execution_count": 19, "metadata": { - "id": "4s24ZNZ3MRKQ", - "outputId": "31ffef53-c17c-4d0d-8b41-efe441dc8493", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "4s24ZNZ3MRKQ", + "outputId": "31ffef53-c17c-4d0d-8b41-efe441dc8493" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Storing program...\n", "Getting quote for operation...\n", @@ -1433,16 +1434,16 @@ "cell_type": "code", "execution_count": 23, "metadata": { - "id": "DgmLvYOb656M", - "outputId": "02141e64-5714-4d66-ede6-2b44ac8179a2", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "DgmLvYOb656M", + "outputId": "02141e64-5714-4d66-ede6-2b44ac8179a2" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Storing input data...\n", "Getting quote for operation...\n", @@ -1469,16 +1470,16 @@ "cell_type": "code", "execution_count": 24, "metadata": { - "id": "DB8mjasbaGYs", - "outputId": "8ff227b8-1eaa-470d-8739-4decf108d4b0", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "DB8mjasbaGYs", + "outputId": "8ff227b8-1eaa-470d-8739-4decf108d4b0" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Logit in plain text: 2.4080795630742746\n", "Probability of spam in plain text: 91.744134%\n" @@ -1543,4 +1544,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/examples/time_series/time_series.ipynb b/examples/time_series/time_series.ipynb index 36abdb6..3428bff 100644 --- a/examples/time_series/time_series.ipynb +++ b/examples/time_series/time_series.ipynb @@ -56,16 +56,16 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "id": "o4PXBlE2v_7K", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "o4PXBlE2v_7K", "outputId": "036c73f6-22c0-4868-ee69-869b987ed74a" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.0/61.0 kB\u001b[0m \u001b[31m1.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.8/54.8 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", @@ -97,21 +97,22 @@ "source": [ "import os\n", "import time\n", - "import sys" + "import sys\n", + "import uuid" ] }, { "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "JxZ3jfRYBlmE" + }, + "outputs": [], "source": [ "# Configure telemetry settings\n", "enable_telemetry = True #@param {type:\"boolean\"}\n", "my_identifier = \"your-telemetry-identifier\" #@param {type:\"string\"}" - ], - "metadata": { - "id": "JxZ3jfRYBlmE" - }, - "execution_count": 3, - "outputs": [] + ] }, { "cell_type": "code", @@ -125,8 +126,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", @@ -173,7 +174,7 @@ "\n", "# Set telemetry if opted in\n", "if enable_telemetry:\n", - " identifier = \"nada-ai-time-series\" + my_identifier\n", + " identifier = f\"nada-ai-time-series-{str(uuid.uuid4())}-{my_identifier}\"\n", " !echo 'yes' | nilup instrumentation enable --wallet {identifier}\n", "\n", "# Install the lastest SDK and initialise it\n", @@ -194,8 +195,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "nohup: appending output to 'nohup.out'\n" ] @@ -212,16 +213,16 @@ "cell_type": "code", "execution_count": 6, "metadata": { - "id": "4teHBr6W5_Mz", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "4teHBr6W5_Mz", "outputId": "5b0684da-f21e-49f8-ee44-6ab2846f6cae" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Cloning into 'nada-ai'...\n", "remote: Enumerating objects: 1483, done.\u001b[K\n", @@ -273,8 +274,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Building program: \u001b[1m\u001b[32mtime_series\u001b[39m\u001b[0m\n", "\u001b[1;32mBuild complete!\u001b[0m\n" @@ -297,8 +298,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "time_series.nada.bin\n" ] @@ -343,8 +344,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Running test: \u001b[1m\u001b[32mtime_series\u001b[39m\u001b[0m\n", "Building ...\n", @@ -390,8 +391,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "15:11:42 - cmdstanpy - INFO - Chain [1] start processing\n", "15:11:42 - cmdstanpy - INFO - Chain [1] done processing\n", @@ -472,4 +473,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}