huggingface / huggingface/peft

target_parameters docs: broken example and a wrong regex claim

Open Beginner friendly
#3,727 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
21.7k
Forks
2.5k
Avg merge
4d 12h
Merged PRs (30d)
59

Description

Three small problems in the `target_parameters` documentation. Per the contribution guideline I would like a maintainer's approval before I send a PR. This is related to but distinct from #3721, which fixes grammar in the same area.

**1. The example is not valid Python.** A closing quote is missing:

```python
target_parameters=['feed_forward.experts.gate_up_proj', 'feed_forward.experts.down_proj]
```

Anyone who copies it gets a `SyntaxError`. The same string appears in three places: the class docstring (`src/peft/tuners/lora/config.py:615`), the field help text (line 952), and the rendered API page (`docs/source/package_reference/lora.md`, "Targeting `nn.Parameter` directly").

**2. The field help text claims regex support that does not exist.** Line 945 says:

> List of parameter names or regex expression of the parameter names to replace with LoRA.

The docstring a few lines above states that regex "is not implemented yet", and the matcher in `tuners_utils.py` only does exact and suffix matching. The "or regex expression" part should go.

**3. One garbled sentence in the docstring.** Line 608 reads "List of parameter names of the parameter names to replace with LoRA."

I would pool the three into one small PR — two files, about six lines — the same shape as #3562 / #3568. May I go ahead?

Contributor guide

Open the contributing guide

Research direction

Review the `target_parameters` text in `src/peft/tuners/lora/config.py` at the class docstring and field help text, then update the corresponding section in `docs/source/package_reference/lora.md`. Check `tuners_utils.py` to confirm the supported matching behavior; done means the copied Python examples are valid, the regex claim is removed, and the garbled sentence is corrected in both source and rendered documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.