Operating System
Deployment Method
CUDA Usage
Training Process Details (if applicable)
N/A
Second-Me version
latest master
Describe the bug
2025-06-10 22:59:15 [ERROR] shade_generator.py:711 - Traceback (most recent call last):
File "/app/lpm_kernel/L1/shade_generator.py", line 696, in merge_shades
new_cluster_embedd = self._calculate_merged_shades_center_embed(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lpm_kernel/L1/shade_generator.py", line 570, in _calculate_merged_shades_center_embed
len(shades[0].cluster_info["centerEmbedding"])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Current Behavior
From the code, we can know that the stes BEFORE the creation of global_bio are:
- create shades
- convert shades to shades info
- merge shades
Also, we can know that when shades are firstly created, it doesn't have an ID (id = None), so when we are merging the shades, it will regard the shades as empty as there is no id.
if not shades:
logger.info(
f"No valid shades found for shadeIds: {shade_ids}. Skipping this group."
)
continue
However, I tried to temporarily add id to the shade info class by:
shades_merge_infos = convert_from_shades_to_merge_info(shades)
for i in range(len(shades_merge_infos)):
shades_merge_infos[i].id = str(uuid.uuid4())
I found the first part of the merge shade function would work; but the second half would raise an exception
2025-06-10 22:59:15 [ERROR] shade_generator.py:711 - Traceback (most recent call last):
File "/app/lpm_kernel/L1/shade_generator.py", line 696, in merge_shades
new_cluster_embedd = self._calculate_merged_shades_center_embed(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lpm_kernel/L1/shade_generator.py", line 570, in _calculate_merged_shades_center_embed
len(shades[0].cluster_info["centerEmbedding"])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
I checked the convert_from_shades_to_merge_info function, I found that:
def convert_from_shades_to_merge_info(shades: List[ShadeInfo]) -> List[ShadeMergeInfo]:
return [ShadeMergeInfo(
id=shade.id,
name=shade.name,
aspect=shade.aspect,
icon=shade.icon,
desc_third_view=shade.desc_third_view,
content_third_view=shade.content_third_view,
desc_second_view=shade.desc_second_view,
content_second_view=shade.content_second_view,
cluster_info=None
) for shade in shades]
It directly set cluster_info as None. Thus, in _calculate_merged_shades_center_embed, when we are trying to access cluster_info field, a exception will be raised.
Expected Behavior
The convert_from_shades_to_merge_info should properly initialize the cluster_info field to load cooresponding cluster.
Reproduction Steps
After
# 3.3 Generate features for each cluster and merge them
shades = generate_shades(clusters, l1_generator, notes_list)
shades_merge_infos = convert_from_shades_to_merge_info(shades)
, add this to give each shade_merge_info a temp id.
for i in range(len(shades_merge_infos)):
shades_merge_infos[i].id = str(uuid.uuid4())
Possible Workaround
No response
Additional Information
No response
Link to related Github discussion or issue
No response
Operating System
Deployment Method
CUDA Usage
Training Process Details (if applicable)
N/A
Second-Me version
latest master
Describe the bug
2025-06-10 22:59:15 [ERROR] shade_generator.py:711 - Traceback (most recent call last):
File "/app/lpm_kernel/L1/shade_generator.py", line 696, in merge_shades
new_cluster_embedd = self._calculate_merged_shades_center_embed(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lpm_kernel/L1/shade_generator.py", line 570, in _calculate_merged_shades_center_embed
len(shades[0].cluster_info["centerEmbedding"])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Current Behavior
From the code, we can know that the stes BEFORE the creation of global_bio are:
Also, we can know that when shades are firstly created, it doesn't have an ID (id = None), so when we are merging the shades, it will regard the shades as empty as there is no id.
However, I tried to temporarily add id to the shade info class by:
I found the first part of the merge shade function would work; but the second half would raise an exception
I checked the convert_from_shades_to_merge_info function, I found that:
It directly set cluster_info as None. Thus, in _calculate_merged_shades_center_embed, when we are trying to access cluster_info field, a exception will be raised.
Expected Behavior
The convert_from_shades_to_merge_info should properly initialize the cluster_info field to load cooresponding cluster.
Reproduction Steps
After
, add this to give each shade_merge_info a temp id.
Possible Workaround
No response
Additional Information
No response
Link to related Github discussion or issue
No response