Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ base_model = AutoModelForCausalLM.from_pretrained(
|
|
| 13 |
config.get("phi2_model_name"),
|
| 14 |
low_cpu_mem_usage=True,
|
| 15 |
return_dict=True,
|
| 16 |
-
torch_dtype=torch.
|
| 17 |
trust_remote_code=True
|
| 18 |
)
|
| 19 |
|
|
@@ -52,7 +52,7 @@ def generate_answers(img=None, aud = None, q = None, max_tokens = 30):
|
|
| 52 |
clip_outputs = clip_model(**images)
|
| 53 |
# remove cls token
|
| 54 |
images = clip_outputs.last_hidden_state[:, 1:, :]
|
| 55 |
-
image_embeddings = projection_layer(images).to(torch.
|
| 56 |
inputs_embeddings.append(image_embeddings)
|
| 57 |
|
| 58 |
if aud is not None:
|
|
|
|
| 13 |
config.get("phi2_model_name"),
|
| 14 |
low_cpu_mem_usage=True,
|
| 15 |
return_dict=True,
|
| 16 |
+
torch_dtype=torch.float32,
|
| 17 |
trust_remote_code=True
|
| 18 |
)
|
| 19 |
|
|
|
|
| 52 |
clip_outputs = clip_model(**images)
|
| 53 |
# remove cls token
|
| 54 |
images = clip_outputs.last_hidden_state[:, 1:, :]
|
| 55 |
+
image_embeddings = projection_layer(images).to(torch.float32)
|
| 56 |
inputs_embeddings.append(image_embeddings)
|
| 57 |
|
| 58 |
if aud is not None:
|