Setting Up a Safe, Clean Sandbox
Note: Checked with moderator and received permission to post.
I’m starting a series of posts showing the creation of a local, character-level Transformer model to see how tokens are derived from scratch.
Full disclosure: This isn’t going to be my code! I do not know how to code in python. I asked Gemini to put together a hands-on learning project to break down and show how tokens work. To keep from having a posting that is too long, I will post the different steps that I went through as I did them.
The first step was about setting up the sandbox.
AI suggested this environment setup, and it sounded good to me—plus, Linux Mint needed it to keep things stable. It gave me an isolated environment to work in and keeps me from loading libraries into root that I might not need in the future. To avoid that, the setup does two things:
I set up a separate partition to keep the main drive clean.
It used a Python Virtual Environment (venv), which acts like a self-contained bubble.
The Setup Commands
First, I opened the terminal and navigated to the the directory:
cd /media/easyt/ALVM
Next, I started the virtual environment bubble (I called it ai_env) by entering:
python3 -m venv ai_env
Finally, I activated it. I knew I was in the bubble when the terminal prompt changed to show (ai_env) at the front:
source ai_env/bin/activate
The initial sandbox setup completed the first step for me. Next some code.