Downloads · 30 days
50
34% of all-time downloads
surajkumarmallick/Vaan-V1_400M
Vaan-V1_400M is a text generation model from surajkumarmallick. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Developed by Suraj Kumar Mallick, Vaan-V1400M is a causal language model built on the classic GPT-2 architecture. This model was designed to be a lightweight yet capable assistant, balancing efficiency with a solid kn…
Downloads · 30 days
50
34% of all-time downloads
All-time downloads
149
Public
Parameters
124M
498 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
Developed by Suraj Kumar Mallick, Vaan-V1_400M is a causal language model built on the classic GPT-2 architecture. This model was designed to be a lightweight yet capable assistant, balancing efficiency with a solid knowledge base.
The training of Vaan-V1 followed a multi-stage process to ensure broad general knowledge followed by task-specific instruction following.
The model was pre-trained on a massive corpus to develop linguistic intuition and factual knowledge:
The model underwent Instruction Fine-Tuning (IFT) using:
transformers and accelerate.Vaan-V1_400M is suitable for:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
from threading import Thread
model_id = "surajpuku/Vaan-V1_400M"
# Load tokenizer + model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
device_map="auto" if torch.cuda.is_available() else None
)
if not torch.cuda.is_available():
model.to("cpu")
def stream_generate(prompt):
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
streamer = TextIteratorStreamer(
tokenizer,
skip_prompt=True,
skip_special_tokens=True
)
generation_kwargs = dict(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
do_sample=True,
streamer=streamer
)
thread = Thread(target=model.generate, kwargs=generation_kwargs)
thread.start()
for token in streamer:
print(token, end="", flush=True)
print()
print("Chat started. Type 'exit' to quit.")
while True:
user_input = input("\nYou: ")
if user_input.lower() in ["exit", "quit"]:
break
print("Assistant: ", end="", flush=True)
stream_generate(user_input)