-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
131 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
infrastructure/ami/scripts/install-hugginface-libraries.sh
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
infrastructure/ami/scripts/install-huggingface-libraries.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Activate the neuron virtual environment | ||
source /opt/aws_neuron_venv_pytorch/bin/activate | ||
|
||
echo "Step: install-hugging-face-libraries" | ||
|
||
echo "TRANSFORMERS_VERSION: $TRANSFORMERS_VERSION" | ||
echo "OPTIMUM_NEURON_TAG: $OPTIMUM_NEURON_TAG" | ||
|
||
pip install --upgrade --no-cache-dir \ | ||
"transformers[sklearn,sentencepiece,vision]==$TRANSFORMERS_VERSION" \ | ||
"datasets==2.16.1" \ | ||
"accelerate==0.23.0" \ | ||
"diffusers==0.25.0" \ | ||
"evaluate==0.4.1" \ | ||
"requests==2.31.0" \ | ||
"notebook==7.0.6" \ | ||
"markupsafe==2.1.1" \ | ||
"jinja2==3.1.2" \ | ||
"attrs==23.1.0" | ||
|
||
echo 'export PATH="${HOME}/.local/bin:$PATH"' >> "${HOME}/.bashrc" | ||
|
||
echo "Step: install-and-copy-optimum-neuron-examples" | ||
git clone -b $OPTIMUM_NEURON_TAG https://github.com/huggingface/optimum-neuron.git | ||
|
||
cd optimum-neuron | ||
python setup.py install | ||
cd .. | ||
|
||
mkdir /home/ubuntu/huggingface-neuron-samples/ /home/ubuntu/huggingface-neuron-notebooks/ | ||
mv optimum-neuron/examples/* /home/ubuntu/huggingface-neuron-samples/ | ||
mv optimum-neuron/notebooks/* /home/ubuntu/huggingface-neuron-notebooks/ | ||
rm -rf optimum-neuron | ||
chmod -R 777 /home/ubuntu/huggingface-neuron-samples /home/ubuntu/huggingface-neuron-notebooks | ||
|
||
echo "Step: validate-imports-of-huggingface-libraries" | ||
bash -c 'python -c "import transformers;import datasets;import accelerate;import evaluate;import tensorboard; import torch;"' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
echo "Step: validate-neuron-devices" | ||
neuron-ls | ||
|
||
# Activate the neuron virtual environment | ||
source /opt/aws_neuron_venv_pytorch/bin/activate | ||
|
||
python -c 'import torch' | ||
python -c 'import torch_neuronx' | ||
|
||
echo "Installing Tensorboard Plugin for Neuron" | ||
pip install --upgrade --no-cache-dir \ | ||
"tensorboard-plugin-neuronx" |