Views
No views yet

| Hyperparameter | Value | Description |
|---|---|---|
| Vocab Size | 10,240 | Custom trained Tokenizer |
| Dim (d_model) | 384 | Embedding dimension |
| Layers | 6 | Number of Transformer blocks |
| Heads | 6 | Number of Attention heads |
| Max Context | 256 | Maximum sequence length |
| Normalization | RMSNorm | Root Mean Square Normalization |
| Activation | SwiGLU | Advanced FeedForward Network |
config.py, model.py) to run. You can easily test it in Google Colab in under a minute.1# 1. Install required libraries
2!pip install -q huggingface_hub tokenizers torch
3
4# 2. Download files from Hugging Face
5from huggingface_hub import hf_hub_download
6import torch
7
8repo_id = "khairul5/VibeCheck-22M"
9print("📥 Downloading model files...")
10
11for file in ["config.py", "model.py", "tokenizer.json", "vibecheck_22m.pt"]:
12 hf_hub_download(repo_id=repo_id, filename=file, local_dir=".")
13
14# 3. Initialize Model and Tokenizer
15from tokenizers import Tokenizer
16from config import LMConfig
17from model import TransformerLM
18
19device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
20tokenizer = Tokenizer.from_file("tokenizer.json")
21config = LMConfig()
22model = TransformerLM(config).to(device)
23
24# Load the trained weights
25checkpoint = torch.load("vibecheck_22m.pt", map_location=device, weights_only=False)
26model.load_state_dict(checkpoint['model_state_dict'])
27model.eval()
28
29# 4. Inference Function
30@torch.no_grad()
31def check_vibe(text):
32 prompt = f"Text: {text}\nSentiment: "
33 input_ids = tokenizer.encode(prompt).ids
34 x = torch.tensor([input_ids], dtype=torch.long).to(device)
35
36 generated_tokens = []
37 for _ in range(5):
38 logits, _ = model(x)
39 next_token = torch.argmax(logits[0, -1, :]).item()
40 generated_tokens.append(next_token)
41 x = torch.cat((x, torch.tensor([[next_token]], device=device)), dim=1)
42
43 current_text = tokenizer.decode(generated_tokens)
44 if "<|endoftext|>" in current_text or "\n" in current_text:
45 break
46
47 ans = tokenizer.decode(generated_tokens).replace("<|endoftext|>", "").strip()
48 return f"📝 Input: '{text}'\n🤖 Vibe: {ans}\n"
49
50# 🎯 Test it!
51print(check_vibe("This custom model is absolutely fantastic!"))
52# Output: Positive1@misc{vibecheck22m,
2 author = {Islam, Md. Khairul},
3 title = {VibeCheck-22M: Custom Sentiment Analysis AI},
4 year = {2026},
5 publisher = {Hugging Face},
6 journal = {Hugging Face Repository},
7 howpublished = {\url{[https://huggingface.co/khairul5/VibeCheck-22M](https://huggingface.co/khairul5/VibeCheck-22M)}}
8}