Spaces:
Runtime error
Runtime error
Thedatababbler
commited on
Commit
•
fcca540
1
Parent(s):
8bac429
tested
Browse files
app.py
CHANGED
@@ -13,9 +13,9 @@ def mlm(image, text):
|
|
13 |
# 'location': f'[CLS] The {cls_name} normally appears at or near the [MASK] of a cell. [SEP]',
|
14 |
# 'color': f'[CLS] When a cell is histologically stained, the {cls_name} are in [MASK] color. [SEP]',
|
15 |
# 'shape': f'[CLS] Mostly the shape of {cls_name} is [MASK]. [SEP]',
|
16 |
-
'location': f'This {text} is at [MASK] place
|
17 |
-
'color': f'
|
18 |
-
'shape': f'
|
19 |
#'def': f'{cls_name} is a . [SEP]',
|
20 |
}
|
21 |
ans = list()
|
@@ -23,6 +23,7 @@ def mlm(image, text):
|
|
23 |
device = 'cpu'
|
24 |
for k, v in questions_dict.items():
|
25 |
predicted_tokens = []
|
|
|
26 |
tokenized_text = tokenizer.tokenize(v)
|
27 |
indexed_tokens = tokenizer.convert_tokens_to_ids(tokenized_text)
|
28 |
# Create the segments tensors.
|
|
|
13 |
# 'location': f'[CLS] The {cls_name} normally appears at or near the [MASK] of a cell. [SEP]',
|
14 |
# 'color': f'[CLS] When a cell is histologically stained, the {cls_name} are in [MASK] color. [SEP]',
|
15 |
# 'shape': f'[CLS] Mostly the shape of {cls_name} is [MASK]. [SEP]',
|
16 |
+
'location': f'This {text} is at [MASK] place',
|
17 |
+
'color': f'This {text} is in [MASK] color',
|
18 |
+
'shape': f'This {text} is in [MASK] shape',
|
19 |
#'def': f'{cls_name} is a . [SEP]',
|
20 |
}
|
21 |
ans = list()
|
|
|
23 |
device = 'cpu'
|
24 |
for k, v in questions_dict.items():
|
25 |
predicted_tokens = []
|
26 |
+
print(v)
|
27 |
tokenized_text = tokenizer.tokenize(v)
|
28 |
indexed_tokens = tokenizer.convert_tokens_to_ids(tokenized_text)
|
29 |
# Create the segments tensors.
|