#MacOs #Python #GPT-2 #M1
This is a tutorial that will show you how to install GPT-2 on Silicon Macs.
Commands used in this video:
To make a virtual environment in python 3.6 (it must be 3.6 for this tutorial to work):
python -m venv venv
Activate the Venv:
. venv/bin/activate
Upgrade Pip:
pip install --upgrade pip
Clone GPT-2 Repo:
git clone https://github.com/openai/gpt-2.git
Change requirements txt for regex in requirements.txt to:
regex == 2021.9.30
Install requirements:
pip install -r requirements.txt
Download your desired model (124M in this video but you can also choose 355M, 774M, and 1558M:
python3 download_model.py 124M
Install the special version of TensorFlow 1.5.0 for mac cpu. Careful, this link may be modified by youtube so refer to the pinned comment in the comments sections if you have problems.
pip install https://storage.googleapis.com/tensor...
Fix the sort command:
sudo sed -ie s/sort\(/contrib\.framework\.sort\(/g src/sample.py
By the way, this is a Linux command that uses the sed utility to modify the contents of a file. The -ie options tell sed to edit the file in-place and to use extended regular expressions. The s/sort\(/contrib\.framework\.sort\(/g argument is a search-and-replace operation, which will replace all occurrences of sort( with contrib.framework.sort( in the file src/sample.py.
Run GPT-2:
python3 src/interactive_conditional_samples.py --top_k 40
==
👍🏻 DON'T FORGET TO LIKE COMMENT AND SUBSCRIBE FOR FUTURE VIDEOS!
*********
📲💻Follow me on Twitter:
@CarlosCloudDev
📲💻Follow me on Instagram:
@CarlosSalazarDev
**********
Watch video How to Install OpenAI GPT-2 on Silicon Mac M1/M2. online without registration, duration hours minute second in high quality. This video was added by user Carlos Cloud & Web Developer 29 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,060 once and liked it 45 people.