Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Lable Mapping not aligned when prefixes are set to be an empty string

Open
#19 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Reproduce the failure with all prefixes set to empty strings, then trace compute_duplicated_labels() and the activation_storage[n] assignment where the tensor-size error appears. Compare the sizes of idx_map and dummy_labels; the issue is done when empty prefixes produce matching label sizes without the runtime error.

Written by the indexing model from the issue text.

Description

Hi @ericwtodd

I am trying to play with different prefixes. The default one is: prefixes = {"input":"Q:", "output":"A:","instructions":""}. When I change it to empty string prefixes = {"input":"", "output":"","instructions":""}, I get a error saying that:

activation_storage[n] = stack_filtered
RuntimeError: The expanded size of the tensor (54) must match the existing size (53) at non-singleton dimension 2.  Target sizes: [40, 40, 54, 128].  Tensor sizes: [40, 40, 53, 128]

I have further checked it and found that this is caused by different label size (the size of idx_map is different from dummy_labels).
When the prefix is made of empty strings, the function compute_duplicated_labels() will an index_map that is of different size of dummy label. I try to debug where went wrong and found it too hard to dive in...

The error only pops up when I have empty strings for prefixes. All other prefixes do not have this problem....

It would be great if you could share some insights on this. I wonder have you experienced similar problems when using empty string prefixes...

Dominant language
Python
Stars
200
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ericwtodd/function_vectors

All issues in ericwtodd/function_vectors

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.