CoolFace
Apppublic

Aquaholograph2014/mog1-ai-vslm

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
App README

๐Ÿš€ Mog1 AI (VSLM) - Lightweight PyTorch Small Language Model

![PyTorch](https://pytorch.org/) ![License: MIT](https://opensource.org/licenses/MIT) ![Hugging Face Spaces](https://huggingface.co/spaces/Aquaholograph2014/mog1-ai-vslm) ![GitHub](https://github.com/Aqua-code750/vslm-project)

Mog1 AI (VSLM) is an advanced, lightweight Small Language Model built completely from scratch in PyTorch with zero black-box dependencies. Created by Aqua-code750 / Aquaholograph2014. Designed for high-speed local inference, multi-domain reasoning, free-form interactive chat, and automatic internal pretraining.


๐ŸŒŸ Key Features

  • โ€”๐Ÿง  Built From Scratch in PyTorch: Pure PyTorch implementation of Decoder-Only Multi-Head Self-Attention Transformer blocks.
  • โ€”๐Ÿ“š Multi-Domain Internet Knowledge Base: Pretrained on Computer Science, AI/ML, Python, Science, Math, History, General Knowledge, and Natural Dialogue.
  • โ€”๐Ÿ”„ Auto-Training Engine: Internal automatic pretraining triggers and 1-click Web UI fine-tuning button to update knowledge anytime.
  • โ€”๐Ÿ’ฌ Free-Form Interactive Chat: Real-time CLI (chat.py) and Gradio Web UI (app.py) for natural conversational Q&A.
  • โ€”๐ŸŽฏ Dual Sampling Modes:
  • โ€”Smart Mode: Top-P (Nucleus) & Top-K sampling with temperature scaling for creative, fluent dialogue.
  • โ€”Exact Factual Mode: Low-temperature greedy decoding for precise technical facts.
  • โ€”โšก Lightning Fast CPU & GPU Execution: Runs instantly on standard laptops or CPU servers without requiring high-end GPUs.

๐Ÿ—๏ธ Architecture Specifications

ParameterSpecification
Model Parameters~3.5 Million Parameters
ArchitectureDecoder-Only Causal Transformer
Attention Mechanism8 Multi-Head Self-Attention Heads
Embedding Dimension256
Transformer Layers4 Blocks
Context Window64 Tokens
TokenizationSubword BPE / Tiktoken GPT-2 Fallback
OptimizationAdamW with Cosine Annealing Learning Rate Scheduler

๐Ÿ› ๏ธ Installation & Setup

  1. 1.Clone the Repository:
bash
git clone https://github.com/Aqua-code750/vslm-project.git
cd vslm-project
  1. 1.Install Dependencies:
bash
pip install -r requirements.txt

๐Ÿ’ฌ Usage Guide

1. Gradio Web Interface (Hugging Face / Local)

Launch the interactive web interface locally or deploy to Hugging Face Spaces:

bash
python app.py

2. Interactive Terminal CLI Chat

Run the real-time CLI chat in your terminal:

bash
python chat.py
  • โ€”Type /smart to activate Smart Reasoning Mode.
  • โ€”Type /exact to activate Factual Precision Mode.
  • โ€”Type /auto-train to trigger background model training.

3. Standalone Generation & Testing

Generate answers programmatically for any prompt:

bash
python generate.py

4. Background Auto-Training & Pretraining

Train or fine-tune Mog1 on updated text datasets anytime:

bash
python train.py 60

Or run the background task manager:

bash
python auto_train.py

๐ŸŒ Publish to Hugging Face & GitHub

Publish your trained model and Gradio app to Hugging Face Spaces & GitHub in 1 click:

bash
# 1. Publish to GitHub
python publish.py github https://github.com/Aqua-code750/vslm-project.git

# 2. Publish to Hugging Face Spaces
python publish.py hf Aquaholograph2014/mog1-ai-vslm <YOUR_HF_TOKEN>

๐Ÿ“œ License

This project is licensed under the MIT License.