Spaces:
Running
on
Zero
Running
on
Zero
Remove extra forward pass
Browse files
model.py
CHANGED
@@ -111,7 +111,6 @@ def encode_images(images: list):
|
|
111 |
return_tensors="pt",
|
112 |
).to(device)
|
113 |
doc_inputs = model.prepare_inputs_for_generation(**doc_inputs, use_cache=False)
|
114 |
-
output = model(**doc_inputs, return_dict=True, output_hidden_states=True)
|
115 |
with torch.no_grad():
|
116 |
output = model(**doc_inputs, return_dict=True, output_hidden_states=True)
|
117 |
doc_embeddings = get_embedding(
|
|
|
111 |
return_tensors="pt",
|
112 |
).to(device)
|
113 |
doc_inputs = model.prepare_inputs_for_generation(**doc_inputs, use_cache=False)
|
|
|
114 |
with torch.no_grad():
|
115 |
output = model(**doc_inputs, return_dict=True, output_hidden_states=True)
|
116 |
doc_embeddings = get_embedding(
|