Setting Up Your AI Development Environment for AI Analytics - professorf/data-analytics GitHub Wiki
- Goto https://huggingface.co/ and create an account.
2. Click on: profile pic (upper right corner) > Settings > Access Tokens
3. Click on: Create new token > Read (blue button) > (In text field, enter a label, e.g., My AI Token)
4. Click on: Create token (button)
5. **VERY IMPORTANT** Copy and Paste this token into your .env file, then click the Done button
6. Verify your .env file has the following line and then save:
... All your reddit tokens ...
HUGGINGFACE_TOKEN = (pasted from huggingface) # PLEASE DON'T TYPE "PASTED FROM HUGGINGFACE" PLEASE. It should be hf_...etc## Part 2. Steps for Setting Up your Development Environment for AI Analytics
Doing AI analysis is most easily done in Visual Studio Code, using the Python programming language and the Conda package manager.
First, set up a new 'ai' conda environment
conda create --name ai python=3.12
conda activate aiMany AI tools require the latest packages, which are available on conda-forge, versus the default channel. Execute the following code in a Visual Studio Code terminal window to get the latest packages:
# Add conda-forge to your channels
conda config --add channels conda-forge
conda config --add channels nvidia
conda config --add channels huggingface
# Set channel_priority to strict
# conda config --set channel_priority strict # Don't to this anymoreTo set up your analysis environment to use, first go to:
https://pytorch.org/get-started/locally/
And select the parameters that correspond to your computer capabilities. In the following example, we selected the Stable build, for the Linux operating system, using Conda as the package manager, and Python as the language. We assumed that the computer did not have an Nvidia graphics card so we selected CPU as the compute platform:
However, and this is very important, if you do have an Nvidia graphics card, you should select the highest version of CUDA supported by your card. The substantial increase in speed for your AI, is very much worth it.
Highlight, then copy and paste the text in the Run this Command box into your visual studio code terminal window to complete the installation:
pip3 install torch torchvision torchaudioNext, install the transformers package from the conda-forge channel:
conda install transformers -c conda-forgeFinally, install the sentence transformers package:
conda install -c conda-forge sentence-transformersAt any point in time, if you want to know what version of a package you have do a conda list. For example, to see what version of transformers, you would do:
(Analytics) professorf$ conda list transformers
# packages in environment at /home/professorf/miniconda3/envs/SLAM:
#
# Name Version Build Channel
sentence-transformers 2.6.1 pyhd8ed1ab_0 conda-forge
transformers 4.39.2 pyhd8ed1ab_0 conda-forge