codeShare commited on
Commit
a71f5df
1 Parent(s): 20c0474

Upload sd_token_similarity_calculator.ipynb

Browse files
Google Colab Notebooks/sd_token_similarity_calculator.ipynb CHANGED
@@ -289,9 +289,9 @@
289
  "strength_NEG = 1\n",
290
  "if enable:\n",
291
  " # Get text features for user input\n",
292
- " inputs = tokenizer(text = prompt, padding=True, return_tensors=\"pt\")\n",
293
  " text_features_NEG = model.get_text_features(**inputs)\n",
294
- " text_features_NEG = text_features_NEG/text_features_A.norm(p=2, dim=-1, keepdim=True)\n",
295
  " name_NEG = neg_prompt\n",
296
  " strength_NEG = neg_strength\n",
297
  " #------#"
 
289
  "strength_NEG = 1\n",
290
  "if enable:\n",
291
  " # Get text features for user input\n",
292
+ " inputs = tokenizer(text = neg_prompt, padding=True, return_tensors=\"pt\")\n",
293
  " text_features_NEG = model.get_text_features(**inputs)\n",
294
+ " text_features_NEG = text_features_NEG/text_features_NEG.norm(p=2, dim=-1, keepdim=True)\n",
295
  " name_NEG = neg_prompt\n",
296
  " strength_NEG = neg_strength\n",
297
  " #------#"