Spaces:
Runtime error
Runtime error
Commit
·
36c3aaa
1
Parent(s):
4b29c6a
Remove print statements
Browse files- apps/mlm.py +0 -3
apps/mlm.py
CHANGED
@@ -28,12 +28,9 @@ def app(state):
|
|
28 |
# @st.cache(persist=False) # TODO: Make this work with mlm_state. Currently not supported.
|
29 |
def predict(transformed_image, caption_inputs):
|
30 |
outputs = mlm_state.mlm_model(pixel_values=transformed_image, **caption_inputs)
|
31 |
-
print(outputs.logits.shape)
|
32 |
indices = np.where(caption_inputs["input_ids"] == bert_tokenizer.mask_token_id)[1][0]
|
33 |
-
print(indices)
|
34 |
preds = outputs.logits[0][indices]
|
35 |
scores = np.array(preds)
|
36 |
-
print(scores)
|
37 |
return scores
|
38 |
|
39 |
# @st.cache(persist=False)
|
|
|
28 |
# @st.cache(persist=False) # TODO: Make this work with mlm_state. Currently not supported.
|
29 |
def predict(transformed_image, caption_inputs):
|
30 |
outputs = mlm_state.mlm_model(pixel_values=transformed_image, **caption_inputs)
|
|
|
31 |
indices = np.where(caption_inputs["input_ids"] == bert_tokenizer.mask_token_id)[1][0]
|
|
|
32 |
preds = outputs.logits[0][indices]
|
33 |
scores = np.array(preds)
|
|
|
34 |
return scores
|
35 |
|
36 |
# @st.cache(persist=False)
|