Conversation
Greptile SummaryThis PR fixes a Previous review concerns about dtype and tensor dimensionality have been addressed. One remaining issue worth considering:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[export_keys_values called\ntable_name, device, batch_size] --> B[flush embeddings]
B --> C{Iterate table_names\n& tables}
C -->|name mismatch| C
C -->|name match| D[local_max_rows = table.size]
D --> E{Iterate\nexport_keys_values\nbatches}
E -->|batch| F[Append keys & embeddings\nto keys_list / values_list]
F --> E
E -->|done| G{accumulated_counts\n== local_max_rows?}
G -->|No| H[raise ValueError]
G -->|Yes| C
C -->|loop done| I{len keys_list == 0?}
I -->|Yes — empty table\nOR invalid name| J["Return\n(empty int64 keys,\nempty 0×0 values)"]
I -->|No| K["Return\ntorch.cat(keys_list),\ntorch.cat(values_list, dim=0)"]
style H fill:#f66,color:#fff
style J fill:#ffa,color:#000
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
hi @jiashuy could you help review it? |
|
Hi @gameofdimension, is the PR ready for merging? |
yes |
Signed-off-by: felix01.yu <felix01.yu@vipshop.com>
done formatting |
|
Hi @gameofdimension , we are doing some refactor work, so can you provide a test to the "error handling for empty kv list"? so that we can keep it correct after the refactor. Thanks for your contribution! |
Covers the empty keys_list early-return fix in export_keys_values, ensuring it returns empty tensors instead of crashing on torch.cat([]).
done |
|
Is there anything else I need to complete? @jiashuy |
|
Merged, thanks! |
Description
When the table is empty, the key/value list will also be empty, resulting in a
RuntimeError: torch.cat(): expected a non-empty list of TensorsChecklist