Text Generation
Transformers
Safetensors
English
Tamil
gemma
Eval Results (legacy)
text-generation-inference
Instructions to use abhinand/gemma-2b-tamil with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhinand/gemma-2b-tamil with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abhinand/gemma-2b-tamil")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abhinand/gemma-2b-tamil") model = AutoModelForCausalLM.from_pretrained("abhinand/gemma-2b-tamil", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abhinand/gemma-2b-tamil with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abhinand/gemma-2b-tamil" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abhinand/gemma-2b-tamil", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abhinand/gemma-2b-tamil
- SGLang
How to use abhinand/gemma-2b-tamil 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 "abhinand/gemma-2b-tamil" \ --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": "abhinand/gemma-2b-tamil", "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 "abhinand/gemma-2b-tamil" \ --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": "abhinand/gemma-2b-tamil", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abhinand/gemma-2b-tamil with Docker Model Runner:
docker model run hf.co/abhinand/gemma-2b-tamil
| language: | |
| - en | |
| - ta | |
| license: other | |
| base_model: google/gemma-2b | |
| datasets: | |
| - wikimedia/wikipedia | |
| license_name: gemma-terms-of-use | |
| license_link: https://ai.google.dev/gemma/terms | |
| model-index: | |
| - name: gemma-2b-tamil | |
| results: | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: AI2 Reasoning Challenge (25-Shot) | |
| type: ai2_arc | |
| config: ARC-Challenge | |
| split: test | |
| args: | |
| num_few_shot: 25 | |
| metrics: | |
| - type: acc_norm | |
| value: 47.44 | |
| name: normalized accuracy | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: HellaSwag (10-Shot) | |
| type: hellaswag | |
| split: validation | |
| args: | |
| num_few_shot: 10 | |
| metrics: | |
| - type: acc_norm | |
| value: 71.3 | |
| name: normalized accuracy | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: MMLU (5-Shot) | |
| type: cais/mmlu | |
| config: all | |
| split: test | |
| args: | |
| num_few_shot: 5 | |
| metrics: | |
| - type: acc | |
| value: 38.21 | |
| name: accuracy | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: TruthfulQA (0-shot) | |
| type: truthful_qa | |
| config: multiple_choice | |
| split: validation | |
| args: | |
| num_few_shot: 0 | |
| metrics: | |
| - type: mc2 | |
| value: 34.93 | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: Winogrande (5-shot) | |
| type: winogrande | |
| config: winogrande_xl | |
| split: validation | |
| args: | |
| num_few_shot: 5 | |
| metrics: | |
| - type: acc | |
| value: 65.98 | |
| name: accuracy | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| - task: | |
| type: text-generation | |
| name: Text Generation | |
| dataset: | |
| name: GSM8k (5-shot) | |
| type: gsm8k | |
| config: main | |
| split: test | |
| args: | |
| num_few_shot: 5 | |
| metrics: | |
| - type: acc | |
| value: 12.89 | |
| name: accuracy | |
| source: | |
| url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=abhinand/gemma-2b-tamil | |
| name: Open LLM Leaderboard | |
| # Gemma 2B Tamil v0.1 Alpha - Base Model [Experimental Release] | |
| This is a Tamil foundational model continually pretrained from Google Gemma 2B. This is an experiment to see if Gemma can be adapted for Tamil without expanding vocabulary. While the responses may be rusty at times, it shows a lot of promise for a 2B parameter model. | |
| > **Please Note:** This model, labeled as a FOUNDATIONAL Language Model (LLM), is designed primarily for Causal Language Modeling (LM) purposes. In other words, if you are looking for an instruction following model in Tamil, you may find [abhinand/gemma-2b-it-tamil-v0.1-alpha](https://huggingface.co/abhinand/gemma-2b-it-tamil-v0.1-alpha) more suitable for your needs. | |
| **Procedure:** | |
| 1. The [Gemma base model](https://huggingface.co/google/gemma-2b) was continually pretrained on all available Tamil Wikipedia data for 3 epochs. | |
| 2. The updated model was then finetuned on a mix of English and Tamil alpaca datasets for 5 epochs. Finetuned model can be found [here](https://huggingface.co/abhinand/gemma-2b-it-tamil-v0.1-alpha). | |
| > **Note:** This project is currently under development (FOR TAMIL). The initial pretraining phase may not have been extensive enough, which suggests that the model's performance could improve by extending the pretraining on a larger dataset, such as CulturaX. | |
| ## Model description | |
| - **Model type:** A 2B parameter GPT-like model continually pretrained on all available Tamil data from [Wikipedia dataset](https://huggingface.co/datasets/wikimedia/wikipedia). | |
| - **Language(s):** Bilingual. English and Tamil. | |
| - **License:** [Google Gemma Terms of Use](https://ai.google.dev/gemma/terms) | |
| - **Training Precision:** `bfloat16` | |
| - **Training Hardware:** 4x Nvidia RTX 3090 GPUs | |
| - **Training Cost:** $20 | |
| ## Support my work | |
| If you appreciate this work and would like to support its continued development, consider [buying me a coffee](https://www.buymeacoffee.com/abhinand.b). Your support is invaluable and greatly appreciated. | |
| [](https://www.buymeacoffee.com/abhinand.b) | |
| ## Usage Note | |
| It's important to note that the models have not undergone detoxification. Therefore, while they possess impressive linguistic capabilities, there is a possibility for them to generate content that could be deemed harmful or offensive. We urge users to exercise discretion and supervise the model's outputs closely, especially in public or sensitive applications. | |
| ## Meet the Developers | |
| Get to know the creators behind this innovative model and follow their contributions to the field: | |
| - [Abhinand Balachandran](https://www.linkedin.com/in/abhinand-05/) | |
| We hope this model serves as a valuable tool in your NLP toolkit and look forward to seeing the advancements it will enable in the understanding and generation of the Tamil language. | |
| # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) | |
| Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_abhinand__gemma-2b-tamil) | |
| | Metric |Value| | |
| |---------------------------------|----:| | |
| |Avg. |45.13| | |
| |AI2 Reasoning Challenge (25-Shot)|47.44| | |
| |HellaSwag (10-Shot) |71.30| | |
| |MMLU (5-Shot) |38.21| | |
| |TruthfulQA (0-shot) |34.93| | |
| |Winogrande (5-shot) |65.98| | |
| |GSM8k (5-shot) |12.89| | |