This will be a walk through of select code samples of the book "Transformers for Natural Language Processing and Computer Vision" 3rd Edition by Denis Rothman
mamba activate t4nlpacv
- mamba install conda-forge::openai[embeddings] ... this updated openai from 1.14.0 to 1.15.0, and I don't think the [embeddings] part actually did anything, but added it because of the example of 'pip install openai[embeddings]' ...
mamba activate t4nlpacv
Exploring notebooks in Chapter10.
- mamba install conda-forge::tabulate
- mamba install conda-forge::sentence-transformers
mamba activate t4nlpacv
- pip install bertviz
- pip install xformers
- mamba install conda-forge::shap
Chapter08/Fine_tuning_OpenAI_Models.ipynb ... Fine-tuning OpenAI GPT-3 ... and yeah of course, it uses OpenAI.
mamba activate t4nlpacv-2
- pip install wget
- mamba install conda-forge::seaborn
Re-running the notebooks from Chapter02, Chapter03, Chapter04, Chapter05 ... ... as I go through the book chapters.
Chapter07 notebooks. They all call OpenAI.
mamba activate t4nlpacv
- mamba install conda-forge::openai (1.14.0)
- mamba install conda-forge::tiktoken (0.6.0)
- pip install cohere (4.56)
- pip install lxml
- pip install feedparser
So far for the month of March, I have not made any calls to OpenAI.
Running all 4 notebooks, of which 2 make calls to OpenAI GPT-4, total usage today amounted to $00.06.
mamba activate t4nlpacv
- mamba install conda-forge::accelerate
Back on the 't4nlpacv-2' conda environment for the notebook on Chapter05
- pip install -U trax --dry-run
I ran the above just to see what would get installed if I ran it, and it will install tensorflow-2.16.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl so I did NOT run the actual install command. I MAY do that some later time if I think it will be useful. Another consideration is to create another conda environment for any and all Tensorflow/TRAX related notebooks.
Hmm actually, what I am going to do is this ... I am going to clone this conda environment 't4nlpacv' to 't4nlpacv-2' and then I will install the latest version of Tensorflow and TRAX in that new environment.
- mamba create -n t4nlpacv-2 --clone t4nlpacv
- mamba activate t4nlpacv-2
- pip install tensorflow
- pip install -U trax
- pip install googletrans==4.0.0-rc1
And just because I want to see if I can get trax running with jax on the gpu, I also ran this ... Installing JAX]
- pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
I created a conda environment for this repository:
- mamba create -n t4nlpacv python=3.11
- mamba activate t4nlpacv
- mamba install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
- mamba install conda-forge::transformers
- mamba install conda-forge::jupyterlab
- mamba install conda-forge::ipywidgets
- mamba install conda-forge::accelerate
- mamba install conda-forge::bitsandbytes
- mamba install conda-forge::scikit-learn
- mamba install conda-forge::matplotlib ... this did not install due to many conflicts ... will address later
Ugh ... I need matplotlib to install, so I am going to try this again, but uninstall scikit-learn first: ...
-
mamba uninstall scikit-learn
-
mamba install conda-forge:scikit-learn==1.2.0
-
mamba install conda-forge::matplotlib ... sigh nope! Still a ton of conflicts! ... whelp, gonna kill this environment, and start over ..
-
mamba env remove -n t4nlpacv
STARTING OVER ....
- mamba create -n t4nlpacv python=3.11
- mamba activate t4nlpacv
- mamba install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
- mamba install conda-forge::scikit-learn==1.3.0
- mamba install conda-forge::matplotlib
- mamba install conda-forge::jupyterlab
- mamba install conda-forge::ipywidgets
- mamba install conda-forge::pandas
OK! I am able to run the notebooks from Chapter01! (except for the TensorFlow parts) Nice!
- mamba install conda-forge::transformers
- mamba install conda-forge::gensim
- mamba install conda-forge::nltk