Update llama_customized_models.py
Browse files
llama_customized_models.py
CHANGED
@@ -135,13 +135,10 @@ class LlamaForCausalLMWithNumericalEmbedding(LlamaForCausalLM):
|
|
135 |
for i, (props, props_index, embeds) in enumerate(zip(properties, properties_index, embeddings)):
|
136 |
assert len(props) == len(props_index), "The number of properties should be equal to the number of properties_index."
|
137 |
props = torch.tensor(props, device=embeds.device, dtype=torch.float32).unsqueeze(1)
|
138 |
-
print(props, "props")
|
139 |
num_embeds = self.numerical_embedding(props)
|
140 |
-
print(num_embeds, "num_embeds")
|
141 |
if len(props_index) > 0:
|
142 |
assert embeddings[i, props_index, :].shape == num_embeds.shape, "The shape of the embeddings and the numerical embeddings should be the same."
|
143 |
embeddings[i, props_index, :] = num_embeds
|
144 |
-
print(embeddings, "embedding_after")
|
145 |
|
146 |
return super().forward(
|
147 |
input_ids=None,
|
|
|
135 |
for i, (props, props_index, embeds) in enumerate(zip(properties, properties_index, embeddings)):
|
136 |
assert len(props) == len(props_index), "The number of properties should be equal to the number of properties_index."
|
137 |
props = torch.tensor(props, device=embeds.device, dtype=torch.float32).unsqueeze(1)
|
|
|
138 |
num_embeds = self.numerical_embedding(props)
|
|
|
139 |
if len(props_index) > 0:
|
140 |
assert embeddings[i, props_index, :].shape == num_embeds.shape, "The shape of the embeddings and the numerical embeddings should be the same."
|
141 |
embeddings[i, props_index, :] = num_embeds
|
|
|
142 |
|
143 |
return super().forward(
|
144 |
input_ids=None,
|