Upload sd_token_similarity_calculator.ipynb
Browse files
Google Colab Notebooks/sd_token_similarity_calculator.ipynb
CHANGED
|
@@ -624,27 +624,10 @@
|
|
| 624 |
"\n"
|
| 625 |
],
|
| 626 |
"metadata": {
|
| 627 |
-
"id": "H3JRx5rhWIEo"
|
| 628 |
-
"outputId": "df7f400b-1f0a-4c1e-c6c9-4c3db0491545",
|
| 629 |
-
"colab": {
|
| 630 |
-
"base_uri": "https://localhost:8080/"
|
| 631 |
-
}
|
| 632 |
},
|
| 633 |
-
"execution_count":
|
| 634 |
-
"outputs": [
|
| 635 |
-
{
|
| 636 |
-
"output_type": "stream",
|
| 637 |
-
"name": "stdout",
|
| 638 |
-
"text": [
|
| 639 |
-
"/content\n",
|
| 640 |
-
"/content\n",
|
| 641 |
-
"/content/text-to-image-prompts/vocab/raw\n",
|
| 642 |
-
"/content/text-to-image-prompts/vocab/raw\n",
|
| 643 |
-
"/content/output/vocab/token_vectors\n",
|
| 644 |
-
"/content/output/vocab/text\n"
|
| 645 |
-
]
|
| 646 |
-
}
|
| 647 |
-
]
|
| 648 |
},
|
| 649 |
{
|
| 650 |
"cell_type": "code",
|
|
@@ -841,37 +824,27 @@
|
|
| 841 |
{
|
| 842 |
"cell_type": "code",
|
| 843 |
"source": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 844 |
"# @title Download the text_encodings as .zip\n",
|
| 845 |
"import os\n",
|
| 846 |
"%cd {home_directory}\n",
|
| 847 |
"#os.remove(f'{home_directory}results.zip')\n",
|
| 848 |
"root_output_folder = home_directory + 'output/'\n",
|
| 849 |
"zip_dest = f'{home_directory}results.zip'\n",
|
| 850 |
-
"!zip -r {zip_dest}
|
| 851 |
],
|
| 852 |
"metadata": {
|
| 853 |
-
"id": "V4YCpmWlkPMG"
|
| 854 |
-
"colab": {
|
| 855 |
-
"base_uri": "https://localhost:8080/"
|
| 856 |
-
},
|
| 857 |
-
"outputId": "9eafe028-a982-4b67-adf3-0633cbbe81f7"
|
| 858 |
},
|
| 859 |
-
"execution_count":
|
| 860 |
-
"outputs": [
|
| 861 |
-
{
|
| 862 |
-
"output_type": "stream",
|
| 863 |
-
"name": "stdout",
|
| 864 |
-
"text": [
|
| 865 |
-
"/content\n",
|
| 866 |
-
" adding: content/output/ (stored 0%)\n",
|
| 867 |
-
" adding: content/output/vocab/ (stored 0%)\n",
|
| 868 |
-
" adding: content/output/vocab/text/ (stored 0%)\n",
|
| 869 |
-
" adding: content/output/vocab/text/vocab.json (deflated 71%)\n",
|
| 870 |
-
" adding: content/output/vocab/token_vectors/ (stored 0%)\n",
|
| 871 |
-
" adding: content/output/vocab/token_vectors/vocab.safetensors (deflated 9%)\n"
|
| 872 |
-
]
|
| 873 |
-
}
|
| 874 |
-
]
|
| 875 |
},
|
| 876 |
{
|
| 877 |
"cell_type": "code",
|
|
@@ -1126,13 +1099,6 @@
|
|
| 1126 |
"\n",
|
| 1127 |
"But you have to set CLIP skip to 1 for this to work is intended.\n",
|
| 1128 |
"\n",
|
| 1129 |
-
"For example, this is the result from \"photo of a 🧔🏻♂️\"\n",
|
| 1130 |
-
"\n",
|
| 1131 |
-
"\n",
|
| 1132 |
-
"<div>\n",
|
| 1133 |
-
"<img src=\"https://lemmy.world/pictrs/image/e2b51aea-6960-4ad0-867e-8ce85f2bd51e.jpeg\" width=\"300\"/>\n",
|
| 1134 |
-
"</div>\n",
|
| 1135 |
-
"\n",
|
| 1136 |
"A tutorial on stuff you can do with the vocab.list concluded.\n",
|
| 1137 |
"\n",
|
| 1138 |
"Anyways, have fun with the notebook.\n",
|
|
@@ -1711,8 +1677,7 @@
|
|
| 1711 |
"# See this link for additional stuff to do with shelve: https://docs.python.org/3/library/shelve.html"
|
| 1712 |
],
|
| 1713 |
"metadata": {
|
| 1714 |
-
"id": "iWeFnT1gAx6A"
|
| 1715 |
-
"cellView": "form"
|
| 1716 |
},
|
| 1717 |
"execution_count": null,
|
| 1718 |
"outputs": []
|
|
|
|
| 624 |
"\n"
|
| 625 |
],
|
| 626 |
"metadata": {
|
| 627 |
+
"id": "H3JRx5rhWIEo"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 628 |
},
|
| 629 |
+
"execution_count": null,
|
| 630 |
+
"outputs": []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 631 |
},
|
| 632 |
{
|
| 633 |
"cell_type": "code",
|
|
|
|
| 824 |
{
|
| 825 |
"cell_type": "code",
|
| 826 |
"source": [
|
| 827 |
+
"# Determine if this notebook is running on Colab or Kaggle\n",
|
| 828 |
+
"#Use https://www.kaggle.com/ if Google Colab GPU is busy\n",
|
| 829 |
+
"home_directory = '/content/'\n",
|
| 830 |
+
"using_Kaggle = os.environ.get('KAGGLE_URL_BASE','')\n",
|
| 831 |
+
"if using_Kaggle : home_directory = '/kaggle/working/'\n",
|
| 832 |
+
"%cd {home_directory}\n",
|
| 833 |
+
"#-------#\n",
|
| 834 |
+
"\n",
|
| 835 |
"# @title Download the text_encodings as .zip\n",
|
| 836 |
"import os\n",
|
| 837 |
"%cd {home_directory}\n",
|
| 838 |
"#os.remove(f'{home_directory}results.zip')\n",
|
| 839 |
"root_output_folder = home_directory + 'output/'\n",
|
| 840 |
"zip_dest = f'{home_directory}results.zip'\n",
|
| 841 |
+
"!zip -r {zip_dest} '/content/text-to-image-prompts/tokens'"
|
| 842 |
],
|
| 843 |
"metadata": {
|
| 844 |
+
"id": "V4YCpmWlkPMG"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 845 |
},
|
| 846 |
+
"execution_count": null,
|
| 847 |
+
"outputs": []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 848 |
},
|
| 849 |
{
|
| 850 |
"cell_type": "code",
|
|
|
|
| 1099 |
"\n",
|
| 1100 |
"But you have to set CLIP skip to 1 for this to work is intended.\n",
|
| 1101 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1102 |
"A tutorial on stuff you can do with the vocab.list concluded.\n",
|
| 1103 |
"\n",
|
| 1104 |
"Anyways, have fun with the notebook.\n",
|
|
|
|
| 1677 |
"# See this link for additional stuff to do with shelve: https://docs.python.org/3/library/shelve.html"
|
| 1678 |
],
|
| 1679 |
"metadata": {
|
| 1680 |
+
"id": "iWeFnT1gAx6A"
|
|
|
|
| 1681 |
},
|
| 1682 |
"execution_count": null,
|
| 1683 |
"outputs": []
|