Instructions to use Navyaforaa/LitGram-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Navyaforaa/LitGram-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Navyaforaa/LitGram-1.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Navyaforaa/LitGram-1.5B") model = AutoModelForCausalLM.from_pretrained("Navyaforaa/LitGram-1.5B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Navyaforaa/LitGram-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Navyaforaa/LitGram-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Navyaforaa/LitGram-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Navyaforaa/LitGram-1.5B
- SGLang
How to use Navyaforaa/LitGram-1.5B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Navyaforaa/LitGram-1.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Navyaforaa/LitGram-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Navyaforaa/LitGram-1.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Navyaforaa/LitGram-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Navyaforaa/LitGram-1.5B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Navyaforaa/LitGram-1.5B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Navyaforaa/LitGram-1.5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Navyaforaa/LitGram-1.5B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Navyaforaa/LitGram-1.5B", max_seq_length=2048, ) - Docker Model Runner
How to use Navyaforaa/LitGram-1.5B with Docker Model Runner:
docker model run hf.co/Navyaforaa/LitGram-1.5B
๐ LitGram-1.5B: Domain-Adapted LLM for English Literature & Grammar
Developed by: Navyaforaa โข Model Size: 1.54 Billion Parameters โข Base Architecture: Qwen2.5-1.5B-Instruct
Training Framework: Unsloth AI + PyTorch + TRL โข License: Apache 2.0
๐ Model Overview
LitGram-1.5B is a specialized, domain-adapted language model tailored for English literature scholars, students, UGC NET English aspirants, literary critics, and grammar/syntax researchers.
While standard small language models often struggle with complex literary criticismโfrequently hallucinating generic lists of buzzwords or failing on precise metrical scansionโLitGram has been fine-tuned on an extensive, multi-stage curated dataset designed for text-grounded literary hermeneutics, line-by-line prosody, and rigorous syntactic parsing.
๐ฏ Key Capabilities & Core Domains
1. Applied Literary Theory & Hermeneutics
- Frameworks Covered: New Historicism, Cultural Materialism, Marxism, Feminism, Queer Theory, Psychoanalysis (Freudian & Lacanian), Postcolonial Theory, Ecocriticism, Deconstruction, Reader-Response Theory, and Cultural Studies.
- Defensible Critiques: Answers follow a structured 3-part academic methodology:
- Core Theoretical Premise
- Textual and Historical Evidentiary Grounding
- Critical Limitations and Alternative Readings
- Deep Author Grounding: Specialized corpora for John Milton (Paradise Lost, Samson Agonistes, Lycidas, Areopagitica), William Shakespeare, Geoffrey Chaucer, Jane Austen, Charlotte & Emily Brontรซ, Charles Dickens, Virginia Woolf, James Joyce, and Salman Rushdie.
2. Poetics, Metrical Scansion & Classical Rhetoric
- Line-by-Line Scansion: Accurately identifies syllable stress (
x /), metric feet (iamb, trochee, anapest, dactyl, spondee, pyrrhic), and metric substitutions (e.g. initial trochees, feminine endings, caesuras). - Poetic Forms: Sonnets (Petrarchan, Shakespearean, Spenserian), Villanelles, Terza Rima, Ottava Rima, Spenserian Stanzas, Rhyme Royal, and Heroic Couplets.
- Rhetorical Figures: Chiasmus vs. Antimetabole, Metonymy vs. Synecdoche, Litotes, Hypallage, Zeugma, Symploce, and Asyndeton.
3. Advanced English Grammar & Generative Syntax
- Syntactic Parsing: Clause hierarchy, X-Bar phrase structure breakdown, and constituent analysis.
- Prescriptive & Descriptive Mechanics: Correction of dangling, squinting, and misplaced modifiers; Mandative and counterfactual irrealis were-subjunctive; non-finite verbals (gerund vs. participle vs. infinitive); pronoun case in comparative ellipses; and punctuation conventions.
4. UGC NET English Literature & Research Methodology
- Specialized Units: Indian Writing in English (Raja Rao, Mulk Raj Anand, R.K. Narayan), Dalit Literature aesthetics (Limbale, Bama, Valmiki), English Language Teaching (ELT & Krashen's Hypotheses), British Cultural Studies (Birmingham CCCS, Stuart Hall, Raymond Williams), and MLA 9th Edition research standards.
5. Project Gutenberg Integration
- Grounded in canonical English public-domain texts across poetry, drama, essays, and Victorian/Romantic fiction.
๐ป How to Use LitGram in Python
Using Hugging Face Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Navyaforaa/LitGram-1.5B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{
"role": "system",
"content": "You are LitGram, a specialized model for English literature and English grammar. Give accurate, text-grounded, clearly explained answers."
},
{
"role": "user",
"content": "Scan the metre of Shakespeare's Sonnet 18: 'Shall I compare thee to a summer's day?'"
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.3,
repetition_penalty=1.15
)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
- Downloads last month
- 640
