Spaces:
Sleeping
Sleeping
MinxuanQin
commited on
Commit
·
24da9e2
1
Parent(s):
5487511
debug blip
Browse files
app.py
CHANGED
|
@@ -46,9 +46,11 @@ if uploaded_file is not None:
|
|
| 46 |
blip_ques = blip_processor.tokenizer.cls_token + question
|
| 47 |
batch_input_ids = blip_processor(text=blip_ques, add_special_tokens=False).input_ids
|
| 48 |
batch_input_ids = torch.tensor(batch_input_ids)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
generate_ids = blip_model.generate(pixel_values=pixel_values, input_ids=batch_input_ids, max_length=50)
|
| 51 |
-
blip_output = blip_processor.batch_decode(generate_ids, skip_special_tokens=True)
|
| 52 |
st.text(f"Answer of ViLT: {orig_pred}")
|
| 53 |
-
st.text(f"Answer of BLIP: {blip_output}")
|
| 54 |
st.text(f"Answer after fine-tuning: {pred}")
|
|
|
|
|
|
| 46 |
blip_ques = blip_processor.tokenizer.cls_token + question
|
| 47 |
batch_input_ids = blip_processor(text=blip_ques, add_special_tokens=False).input_ids
|
| 48 |
batch_input_ids = torch.tensor(batch_input_ids)
|
| 49 |
+
st.text(f"input dimension: {batch_input_ids.shape}")
|
| 50 |
+
st.text(f"pixel dimension: {pixel_values.shape}")
|
| 51 |
+
# generate_ids = blip_model.generate(pixel_values=pixel_values, input_ids=batch_input_ids, max_length=50)
|
| 52 |
+
# blip_output = blip_processor.batch_decode(generate_ids, skip_special_tokens=True)
|
| 53 |
|
|
|
|
|
|
|
| 54 |
st.text(f"Answer of ViLT: {orig_pred}")
|
|
|
|
| 55 |
st.text(f"Answer after fine-tuning: {pred}")
|
| 56 |
+
# st.text(f"Answer of BLIP: {blip_output}")
|