Upload sd_token_similarity_calculator.ipynb
Browse files
sd_token_similarity_calculator.ipynb
CHANGED
@@ -122,7 +122,8 @@
|
|
122 |
"outputId": "033c251a-2043-40e7-9500-4da870ffa7fd",
|
123 |
"colab": {
|
124 |
"base_uri": "https://localhost:8080/"
|
125 |
-
}
|
|
|
126 |
},
|
127 |
"execution_count": null,
|
128 |
"outputs": [
|
@@ -387,7 +388,7 @@
|
|
387 |
"start_search_at_index = 0 # @param {type:\"slider\", min:0, max: 49407, step:100}\n",
|
388 |
"# @markdown The lower the start_index, the more similiar the sampled tokens will be to the target token assigned in the '⚡ Get similiar tokens' cell\". If the cell was not run, then it will use tokens ordered by similarity to the \"girl\\</w>\" token\n",
|
389 |
"start_search_at_ID = start_search_at_index\n",
|
390 |
-
"search_range = 1000 # @param {type:\"slider\", min:
|
391 |
"\n",
|
392 |
"samples_per_iter = 10 # @param {type:\"slider\", min:10, max: 100, step:10}\n",
|
393 |
"\n",
|
@@ -442,7 +443,7 @@
|
|
442 |
" #-----#\n",
|
443 |
"\n",
|
444 |
" for index in range(samples_per_iter):\n",
|
445 |
-
" _start = START
|
446 |
" id_C = random.randint(_start , _start + RANGE)\n",
|
447 |
" name_C = db_vocab[f'{id_C}']\n",
|
448 |
" is_Prefix = 0\n",
|
@@ -517,7 +518,7 @@
|
|
517 |
" sorted, indices = torch.sort(dots,dim=0 , descending=True)\n",
|
518 |
" # @markdown ----------\n",
|
519 |
" # @markdown # Print options\n",
|
520 |
-
" list_size = 100 #
|
521 |
" print_ID = False # @param {type:\"boolean\"}\n",
|
522 |
" print_Similarity = True # @param {type:\"boolean\"}\n",
|
523 |
" print_Name = True # @param {type:\"boolean\"}\n",
|
@@ -651,7 +652,8 @@
|
|
651 |
],
|
652 |
"metadata": {
|
653 |
"collapsed": true,
|
654 |
-
"id": "fi0jRruI0-tu"
|
|
|
655 |
},
|
656 |
"execution_count": null,
|
657 |
"outputs": []
|
|
|
122 |
"outputId": "033c251a-2043-40e7-9500-4da870ffa7fd",
|
123 |
"colab": {
|
124 |
"base_uri": "https://localhost:8080/"
|
125 |
+
},
|
126 |
+
"cellView": "form"
|
127 |
},
|
128 |
"execution_count": null,
|
129 |
"outputs": [
|
|
|
388 |
"start_search_at_index = 0 # @param {type:\"slider\", min:0, max: 49407, step:100}\n",
|
389 |
"# @markdown The lower the start_index, the more similiar the sampled tokens will be to the target token assigned in the '⚡ Get similiar tokens' cell\". If the cell was not run, then it will use tokens ordered by similarity to the \"girl\\</w>\" token\n",
|
390 |
"start_search_at_ID = start_search_at_index\n",
|
391 |
+
"search_range = 1000 # @param {type:\"slider\", min:100, max:49407, step:100}\n",
|
392 |
"\n",
|
393 |
"samples_per_iter = 10 # @param {type:\"slider\", min:10, max: 100, step:10}\n",
|
394 |
"\n",
|
|
|
443 |
" #-----#\n",
|
444 |
"\n",
|
445 |
" for index in range(samples_per_iter):\n",
|
446 |
+
" _start = START\n",
|
447 |
" id_C = random.randint(_start , _start + RANGE)\n",
|
448 |
" name_C = db_vocab[f'{id_C}']\n",
|
449 |
" is_Prefix = 0\n",
|
|
|
518 |
" sorted, indices = torch.sort(dots,dim=0 , descending=True)\n",
|
519 |
" # @markdown ----------\n",
|
520 |
" # @markdown # Print options\n",
|
521 |
+
" list_size = 100 # param {type:'number'}\n",
|
522 |
" print_ID = False # @param {type:\"boolean\"}\n",
|
523 |
" print_Similarity = True # @param {type:\"boolean\"}\n",
|
524 |
" print_Name = True # @param {type:\"boolean\"}\n",
|
|
|
652 |
],
|
653 |
"metadata": {
|
654 |
"collapsed": true,
|
655 |
+
"id": "fi0jRruI0-tu",
|
656 |
+
"cellView": "form"
|
657 |
},
|
658 |
"execution_count": null,
|
659 |
"outputs": []
|