Repository navigation
Description
What happened?
m alora add-readme fails to generate a README for repositories whose names are hyphenated or whose namespace is an organization, burning the full rejection-sampling budget (~10 minutes against a local ollama granite4.2:3b) before giving up.
Observed with a real flat-layout repository:
$ m alora add-readme stembolt_failure_dataset.jsonl \
--basemodel facebook/opt-350m --name peft-internal-testing/opt-350m-lora
Checking peft-internal-testing/opt-350m-lora on Hugging Face (read-only) to detect its adapter layout.
Detected the flat adapter layout in peft-internal-testing/opt-350m-lora.
...
RejectionSamplingStrategy: 100%|██████████| 10/10 [09:44<01:11]
FAILED. Valid: 3/6. Failed:
- userid must be 'peft-internal-testing'
- arglist must be a valid Python argument listuserid must be 'peft-internal-testing' failed on 9 of the 10 attempts. With LLM-friendly names the same command succeeds quickly (your-username/stembolts on the first attempt, nfulton/stembolts on the fifth).
What did you expect to happen?
README generation should not depend on the repository name being shaped like the prompt's examples.
How can we reproduce it?
ollama servewith a small model pulled (ollama pull granite4.2:3b).m alora add-readme docs/examples/aLora/stembolt_failure_dataset.jsonl --basemodel facebook/opt-350m --name peft-internal-testing/opt-350m-lora- Answer
noat the upload prompt (not reached here — the failure happens during generation).
The Hub is only read; nothing is uploaded.
Mellea version
main.
Any environmental details we need to know?
ollama with granite4.2:3b. Larger models may satisfy the constraints more often, but the prompt contradiction (below) remains.
Anything else we need to know?
The cause is that the generator asks the LLM to produce two values the code already knows, then enforces them with exact-match requirements, while the prompt simultaneously gives conflicting guidance (cli/alora/readme_generator.py, make_readme_jinja_dict and _make_requirements):
- userid: Set this to "your-username" as a placeholder for the HuggingFace user ID. MUST be {name.split("/")[0]}
- intrinsic_name: A short snake_case identifier for this adapter (e.g., "stembolts"). No hyphens. MUST be {name.split("/")[1]}
For peft-internal-testing/opt-350m-lora the leaf violates "No hyphens" and the namespace is nothing like "your-username", so the MUST constraints contradict the prompt's own examples and a small model cannot reconcile them.
Since userid and intrinsic_name are both derived from --name, which the command already has, the LLM does not need to produce them at all: filling them programmatically and asking the model only for the descriptive fields (high-level description, dataset description, argument list, camel-case name) would remove this failure mode for every repository name and shorten sampling for the friendly ones too. Alternatively, weakening the "no hyphens"/"your-username" guidance when the pinned value contradicts it would help, but keeps a pointless round-trip.
Found while validating #1861 end to end; the affected code predates that PR and behaves the same on main.
Activity