Skip to content

Commit

Permalink
Remove loralib reqs from examples, small fixes (huggingface#640)
Browse files Browse the repository at this point in the history
- As discussed, loralib is no longer required, so the examples from the
  docs have been updated to no longer require loralib as dependencies
- In one example, a missing torch import was added
- In another example, a missing line was added (output of that line is
  shown, but not the line itself)
  • Loading branch information
BenjaminBossan authored Jun 28, 2023
1 parent f4526d5 commit 563acf0
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/source/task_guides/clm-prompt-tuning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ dataset = dataset.map(
batched=True,
num_proc=1,
)
dataset["train"][0]
{"Tweet text": "@HMRCcustomers No this is my first job", "ID": 0, "Label": 2, "text_label": "no complaint"}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/task_guides/image_classification_lora.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For more information on LoRA, please refer to the [original LoRA paper](https://
Install the libraries required for model training:

```bash
!pip install transformers accelerate evaluate datasets loralib peft -q
!pip install transformers accelerate evaluate datasets peft -q
```

Check the versions of all required libraries to make sure you are up to date:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/task_guides/semantic_segmentation_lora.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For more information on LoRA, please refer to the [original LoRA paper](https://
Install the libraries required for model training:

```bash
!pip install transformers accelerate evaluate datasets loralib peft -q
!pip install transformers accelerate evaluate datasets peft -q
```

## Authenticate to share your model
Expand Down
1 change: 1 addition & 0 deletions docs/source/task_guides/seq2seq-prefix-tuning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ from peft import get_peft_config, get_peft_model, get_peft_model_state_dict, Pre
from datasets import load_dataset
from torch.utils.data import DataLoader
from tqdm import tqdm
import torch
import os

os.environ["TOKENIZERS_PARALLELISM"] = "false"
Expand Down
1 change: 0 additions & 1 deletion examples/causal_language_modeling/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
transformers
accelerate
loralib
evaluate
deepspeed
tqdm
Expand Down
1 change: 0 additions & 1 deletion examples/conditional_generation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
transformers
accelerate
loralib
evaluate
deepspeed
tqdm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
],
"source": [
"!pip install transformers accelerate evaluate datasets loralib git+https://github.com/huggingface/peft -q"
"!pip install transformers accelerate evaluate datasets git+https://github.com/huggingface/peft -q"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}
],
"source": [
"!pip install -q bitsandbytes datasets accelerate loralib\n",
"!pip install -q bitsandbytes datasets accelerate\n",
"!pip install -q git+https://github.com/huggingface/transformers.git@main git+https://github.com/huggingface/peft.git@main"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/int8_training/Finetune_opt_bnb_peft.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
],
"source": [
"!pip install -q bitsandbytes datasets accelerate loralib\n",
"!pip install -q bitsandbytes datasets accelerate\n",
"!pip install -q git+https://github.com/huggingface/transformers.git@main git+https://github.com/huggingface/peft.git"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"!pip install evaluate>=0.30\n",
"!pip install jiwer\n",
"!pip install gradio\n",
"!pip install -q bitsandbytes datasets accelerate loralib\n",
"!pip install -q bitsandbytes datasets accelerate\n",
"!pip install -q git+https://github.com/huggingface/transformers.git@main git+https://github.com/huggingface/peft.git@main"
]
},
Expand Down
1 change: 0 additions & 1 deletion examples/lora_dreambooth/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
transformers
accelerate
loralib
evaluate
tqdm
datasets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"outputs": [],
"source": [
"!pip install transformers accelerate evaluate datasets loralib git+https://github.com/huggingface/peft -q"
"!pip install transformers accelerate evaluate datasets git+https://github.com/huggingface/peft -q"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion examples/sequence_classification/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
transformers
accelerate
loralib
evaluate
tqdm
datasets
1 change: 0 additions & 1 deletion examples/token_classification/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
transformers
accelerate
loralib
evaluate
tqdm
datasets
Expand Down

0 comments on commit 563acf0

Please sign in to comment.