microsoft / microsoft/dp-transformers
Cannot import name 'convert_gpt2_attention_to_lora' from 'dp_transformers.module_modification'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 149
- Forks
- 33
- Avg merge
- 22h 6m
- Merged PRs (30d)
- 1
Description
I finetuned GPT-2 with LORA using the latest dp-transformers library and 1 GPU. I am now trying to use the fine-tuned model to generate synthetic private text data using the following command-line code script following the instruction on this page:
python3 generate-text.py \
--model_type gpt2 \
--model_name_or_path output \
--input_training_file data \
--output_dir synthetic_data \
--length 128 \
--total_sequences 100 \
--do_sample \
--batch_size 8 \
--lora_dim 4 \
--lora_alpha 32 \
--lora_dropout`` 0.0 \
However, an error occurred: ImportError: cannot import name 'convert_gpt2_attention_to_lora' from 'dp_transformers.module_modification' I checked the source code of dp_transformers.module_modification and found that there is indeed no function called convert_gpt2_attention_to_lora. Will the library be updated to make sure the synthetic private text generation could work?
Thanks for your time.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with research/synthetic-text-generation-with-DP/generate-text.py and inspect its import of convert_gpt2_attention_to_lora, then compare it with the current dp_transformers.module_modification contents. Verify the documented command against the current library. Done means the import succeeds and the synthetic private text generation workflow can run as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100