Spaces:
Sleeping
Sleeping
Update general_bias_measurement.py
Browse files- general_bias_measurement.py +11 -1
general_bias_measurement.py
CHANGED
|
@@ -21,13 +21,23 @@ BLIP_model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image
|
|
| 21 |
CLIP_model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14").to(device)
|
| 22 |
CLIP_processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
irrelevantWords = ['a', 'an', 'with', 'the', 'and', 'for', 'on', 'their', 'this', 'that', 'under', 'it', 'at', 'out',
|
| 25 |
'in', 'inside', 'outside', 'of', 'many', 'one', 'two', 'three', 'four', 'five', '-', 'with',
|
| 26 |
'six', 'seven', 'eight', 'none', 'ten', 'at', 'is', 'up', 'are', 'by', 'as', 'ts', 'there',
|
| 27 |
'like', 'bad', 'good', 'who', 'through', 'else', 'over', 'off', 'on', 'next',
|
| 28 |
'to', 'into', 'themselves', 'front', 'down', 'some', 'his', 'her', 'its', 'onto', 'eaten',
|
| 29 |
'each', 'other', 'most', 'let', 'around', 'them', 'while', 'another', 'from', 'above', "'",
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
# Variables for the LLM
|
| 33 |
maxLength = 10
|
|
|
|
| 21 |
CLIP_model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14").to(device)
|
| 22 |
CLIP_processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
|
| 23 |
|
| 24 |
+
#irrelevantWords = ['a', 'an', 'with', 'the', 'and', 'for', 'on', 'their', 'this', 'that', 'under', 'it', 'at', 'out',
|
| 25 |
+
# 'in', 'inside', 'outside', 'of', 'many', 'one', 'two', 'three', 'four', 'five', '-', 'with',
|
| 26 |
+
# 'six', 'seven', 'eight', 'none', 'ten', 'at', 'is', 'up', 'are', 'by', 'as', 'ts', 'there',
|
| 27 |
+
# 'like', 'bad', 'good', 'who', 'through', 'else', 'over', 'off', 'on', 'next',
|
| 28 |
+
# 'to', 'into', 'themselves', 'front', 'down', 'some', 'his', 'her', 'its', 'onto', 'eaten',
|
| 29 |
+
# 'each', 'other', 'most', 'let', 'around', 'them', 'while', 'another', 'from', 'above', "'",
|
| 30 |
+
# '-', 'about', 'what', '', ' ', 'A', 'looks', 'has', 'background', 'behind' ]
|
| 31 |
+
|
| 32 |
+
# Adding colors to limit
|
| 33 |
irrelevantWords = ['a', 'an', 'with', 'the', 'and', 'for', 'on', 'their', 'this', 'that', 'under', 'it', 'at', 'out',
|
| 34 |
'in', 'inside', 'outside', 'of', 'many', 'one', 'two', 'three', 'four', 'five', '-', 'with',
|
| 35 |
'six', 'seven', 'eight', 'none', 'ten', 'at', 'is', 'up', 'are', 'by', 'as', 'ts', 'there',
|
| 36 |
'like', 'bad', 'good', 'who', 'through', 'else', 'over', 'off', 'on', 'next',
|
| 37 |
'to', 'into', 'themselves', 'front', 'down', 'some', 'his', 'her', 'its', 'onto', 'eaten',
|
| 38 |
'each', 'other', 'most', 'let', 'around', 'them', 'while', 'another', 'from', 'above', "'",
|
| 39 |
+
'-', 'about', 'what', '', ' ', 'A', 'looks', 'has', 'background', 'behind',
|
| 40 |
+
'red', 'blue', 'green', 'brown', 'yellow', 'purple', 'orange', 'white', 'black' ]
|
| 41 |
|
| 42 |
# Variables for the LLM
|
| 43 |
maxLength = 10
|