Skip to content

Global biography generation failure #385

@Heterohabilis

Description

@Heterohabilis

Operating System

  • macOS
  • Linux
  • Windows

Deployment Method

  • Docker
  • non-Docker

CUDA Usage

  • Yes
  • No

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:

  1. create shades
  2. convert shades to shades info
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions