Downloads · 30 days
19
1% of all-time downloads
DZER-Studios/Create_Vexion-LM
Create_Vexion-LM is a text generation model from DZER-Studios. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Vexion-LM is a family of open-source language models built from scratch. The project includes a complete pipeline: from writing a custom architecture in PyTorch to pretraining base models and then retraining them for…
Downloads · 30 days
19
1% of all-time downloads
All-time downloads
3.2K
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json4.3 MB · 98%
From the Hugging Face model README
Vexion-LM is a family of open-source language models built from scratch. The project includes a complete pipeline: from writing a custom architecture in PyTorch to pretraining base models and then retraining them for the conversational format using LoRA adapters.
AdamW8bit) from the bitsandbytes library, allowing models to be trained locally on consumer GPUs.Create_Vexion-LM - allows you to train this model from scratch or further train it. All files, from generate.py to train.py, are available here. Create your own models using Custom_architecture!
This model is built on a completely custom architecture, written in pure PyTorch.
It DOES NOT support the Hugging Face 'transformers' library (Transformer API). You cannot load it through standard classes like 'AutoModelForCausalLM'. For inference and retraining, use exclusively the scripts provided in this repository ('model.py', 'generate.py', 'generation.py').
generate.py, the code automatically uses automatic mixed-precision (AMP via torch.amp.autocast), switching to FP16 or BF16 on supported GPUs to save video memory and speed up execution. Manual weight conversion is not required.LoRA: Since the model is built on a custom architecture, the generate.py file is included in the repository, which is used to run it. It is launched via the terminal/command line (CMD, PowerShell, VSCode terminal). The LoRA model (pre-trained using dialogs) can only be run using generate.py.
PreTrained: If the model is pre-trained, generate.py is NOT SUITABLE. Use generate.py to communicate with the model. Keep in mind that a pre-trained model cannot communicate; it functions as a "text extension." ##
This guide will help you prepare data and train a language model on your home graphics card.
Step 1: Preparing the Workspace:
Models/. Place all scripts (train.py, Prepare_data.py, etc.) in it.checkpoints/ folder. This is critical: the model will save its weights (checkpoints) here during training, preventing you from losing progress.train.txt - the main, large text file on which the model will train.val.txt - a short validation text needed to monitor quality and prevent overfitting.Step 2: Creating a Custom Tokenizer
The model doesn't understand letters; it understands tokens (word fragments). We need to train the BPE tokenizer on your text so that it understands the language perfectly.
Open the train_tokenizer.py file and enter your tokenizer's value in the vocab_size= field. This ensures that the tokenizer is created 100% of the time.
Then open the console (CMD), navigate to the project folder, and enter the following command:
python train.py --data_path train.txt --total_steps 40000 --embed_dim 768 --n_layers 12 --n_heads 12 --vocab_size 40960
(Replace train.txt with your file name if different). What will happen? The script will parse your text and create a tokenizer.json file with a vocabulary size of 40960 tokens (a multiple of 64 is ideal for GPU performance). After creating the tokenizer, the script will return an error – this is absolutely normal! The error occurs because the script itself requires binary formats, not .txt, for training. The main thing is that the tokenizer is ready!
Step 3: Converting the dataset to binary format (.bin)
To prevent the graphics card and RAM from choking on gigabytes of text, we convert it to a special format, np.memmap.
Step 4: Running Training**
Now you have everything you need. Return to the console and run the final command:
python train.py --data_path train.bin --val_path val.bin --total_steps 40000 --save_every 1000 --batch_size 4 --accumulate_steps 16 --embed_dim 768 --n_layers 12 --n_heads 12 --max_seq_len 1024 --lr 1e-4 --vocab_size 40960
⚙️Analysis of launch parameters Carefully adjust these parameters for your graphics card, otherwise you risk getting an OUT OF MEMORY error (insufficient VRAM):
checkpoints/ folder.Create a checkpoints folder in the project directory and place the downloaded model file there (e.g., model.safetensors). Open a terminal and navigate to the project folder:
cd C:\Users\YourName\Desktop\FileName
### 2. Run
For plain text: python generate.py --checkpoint checkpoints/model.safetensors --prompt "Is artificial intelligence dangerous?" --temperature 0.7 --rep_penalty 1.2 --max_new_tokens 400 --device cuda
For dialog text: python generate.py --checkpoint checkpoints/Vexion-LM_mini_lora.safetensors --prompt "[CLS] What is a human [SEP]" --temperature 0.7 --device cuda --use_lora
📝 Prompt writing rules:
[CLS] is the special token at the beginning of your request. Write your question after it.
[SEP] is the special token at the beginning of the AI's response. No text should be written after this token, otherwise the model will break the response logic!
The --use_lora flag is required when running dialog versions of the model so that the script includes additional adapter weights.