Skip to content

BUG: sample_from_island method in PromptDatabase #437

@0-1CxH

Description

@0-1CxH

current code:

if not island_programs:
...
    return self.sample(num_inspirations)

in self.sample, the complex _sample_inspirations method is used, but when the island is not empty, it simply uses random sampling:

        if len(other_programs) < num_inspirations:
            # Not enough programs in island, use what we have
            inspiration_ids = other_programs
        else:
            # Sample inspirations
            inspiration_ids = random.sample(other_programs, num_inspirations)

I think the _sample_inspirations meant to be used in all cases, not only the empty island case.

It is easy to fix tho, I just would like to point out this.

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