Instructions to use LingoIITGN/ganga-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LingoIITGN/ganga-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LingoIITGN/ganga-1b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LingoIITGN/ganga-1b") model = AutoModelForCausalLM.from_pretrained("LingoIITGN/ganga-1b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LingoIITGN/ganga-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LingoIITGN/ganga-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LingoIITGN/ganga-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LingoIITGN/ganga-1b
- SGLang
How to use LingoIITGN/ganga-1b 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 "LingoIITGN/ganga-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LingoIITGN/ganga-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "LingoIITGN/ganga-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LingoIITGN/ganga-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LingoIITGN/ganga-1b with Docker Model Runner:
docker model run hf.co/LingoIITGN/ganga-1b
Model Card for Ganga-1b! 🌊
The base model Ganga-1b trained on a monolingual Hindi language dataset as part of Project Unity. We propose the name Ganga 🌊 to honor the longest river flowing through the Hindi-speaking region of India 🇮🇳.
(The first pre-trained Hindi model by any academic research lab in India 🇮🇳!)*
Model Description 📚
Project Unity is an initiative to address India's linguistic diversity and richness by creating a comprehensive resource covering the country's major languages. We strive to achieve state-of-the-art performance in understanding and generating text in Indian languages. To achieve this, we train models on the monolingual regional languages of India. Our first release is the Ganga-1B model, which has been trained on a large dataset of public domain web-crawled Hindi language data, including news articles, web documents, books, government publications, educational materials, and social media conversations (filtered for quality). Additionally, the dataset has been further curated by native Indian speakers to ensure high quality. Significantly, the Ganga-1B model outperforms existing open-source models that support Indian languages, even at sizes of up to 7 billion parameters.
- Developed by: Lingo Research Group at IIT Gandhinagar
- Model type: Autoregressive Language Model
- Language(s) (NLP): Bilingual (Primary: Hindi [hi], Secondary: English [en])
- License: Apache 2.0
How to Get Started with the Model 👨🏻💻
Use the code below to get started with the model.
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("LingoIITGN/ganga-1b")
model = AutoModelForCausalLM.from_pretrained("LingoIITGN/ganga-1b", device_map="auto")
input_text = "BCCI ने टी-20 वर्ल्ड कप के बीच जिम्बाब्वे सीरीज "
input_ids = tokenizer.encode(input_text,
return_tensors="pt").to("cuda")
outputs = model.generate(input_ids, max_new_tokens=100,
do_sample=True, top_k=50,
top_p=0.95, temperature=0.7)
print(tokenizer.decode(outputs[0]))
Technical Specifications 🤖
- Precision: Float32
- Context Length: 2,048
- Learning Rate: 4e-4
- Optimizer: AdamW
- LR Scheduler: Cosine
Model Architecture and Objective
Ganga-1b is a decoder-only transformer model, featuring the following specifications:
- Layers: 16
- Attention heads: 32
- Embedding dimension: 2,048
- Vocabulary size: 30,000
- Sliding window: 512
- Intermediate dimension: 7,168
Evaluation
[More Information Needed]
Results 🏆
Tokenizers Results
| Model | Fertility |
|---|---|
| Ganga-1b | 1.12 |
| Pragna-1b | 1.58 |
| Bloom-1b1 | 1.27 |
| Bloom-1b7 | 1.27 |
| Gemma-2b | 1.89 |
| Bloom-3b | 1.27 |
| Airavata-7b | 1.69 |
| Sarvam-2b | 1.38 |
Metrics
| Model | PPLOur Dataset | PPLSangraha Dataset |
|---|---|---|
| Ganga-1b | 17.92 | 15.82 |
| Pragna-1b | 98.16 | 9.37 |
| Bloom-1b1 | 27.81 | 17.49 |
| Bloom-1b7 | 22.49 | 14.28 |
| Gemma-2b | 49.27 | 31.01 |
| Bloom-3b | 19.99 | 12.82 |
| OpenHathi-7B | 42.95 | 25.73 |
| Airavata-7b | 60.87 | 38.24 |
| Sarvam-2b | 18.56 | 10.31 |
Summary
Bias, Risks, and Limitations 🚨
Recommendations ‼️
This model described is a research preview and is under ongoing iterative updations, and as such, it only provides limited safety measures. Additionally, it may generate offensive content. It is strictly prohibited to use the model for any illegal, harmful, violent, racist, or sexual purposes.
More Information
DEMO: https://huggingface.co/spaces/Lingo-IITGN/ganga-1b
Model Card Contact ✉️
Lingo Research Group at IIT Gandhinagar, India
Mail at: lingo@iitgn.ac.in
- Downloads last month
- 33
