Instructions to use ReSearchX/pythia-70m-finetuned-alpaca-hindi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ReSearchX/pythia-70m-finetuned-alpaca-hindi with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ReSearchX/pythia-70m-finetuned-alpaca-hindi")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ReSearchX/pythia-70m-finetuned-alpaca-hindi") model = AutoModelForCausalLM.from_pretrained("ReSearchX/pythia-70m-finetuned-alpaca-hindi", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ReSearchX/pythia-70m-finetuned-alpaca-hindi with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ReSearchX/pythia-70m-finetuned-alpaca-hindi" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ReSearchX/pythia-70m-finetuned-alpaca-hindi", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ReSearchX/pythia-70m-finetuned-alpaca-hindi
- SGLang
How to use ReSearchX/pythia-70m-finetuned-alpaca-hindi 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 "ReSearchX/pythia-70m-finetuned-alpaca-hindi" \ --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": "ReSearchX/pythia-70m-finetuned-alpaca-hindi", "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 "ReSearchX/pythia-70m-finetuned-alpaca-hindi" \ --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": "ReSearchX/pythia-70m-finetuned-alpaca-hindi", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ReSearchX/pythia-70m-finetuned-alpaca-hindi with Docker Model Runner:
docker model run hf.co/ReSearchX/pythia-70m-finetuned-alpaca-hindi
Pythia-70M Fine-tuned on Hindi Alpaca
This repository contains the EleutherAI/pythia-70m model, fully fine-tuned on the iamshnoo/alpaca-cleaned-hindi dataset for Hindi instruction-following tasks.
Model Description
This model is a 70-million parameter autoregressive language model from the Pythia suite, developed by EleutherAI to facilitate research on large language models. It has been adapted through full-parameter fine-tuning to understand and respond to instructions in Hindi.
Intended Use and Limitations
The model is intended for research and experimentation in Hindi natural language generation and instruction-following. It can be used as a base for further fine-tuning on more specific tasks.
Limitations:
- The model's knowledge is limited to the data it was trained on (The Pile and the Hindi Alpaca dataset).
- It may generate factually incorrect or biased information.
- Performance on complex reasoning or highly specialized topics has not been extensively evaluated.
Fine-tuning Procedure
Hardware
The model was fine-tuned on a high-VRAM GPU (NVIDIA A100/RTX 6000 Ada) using bfloat16 precision.
Hyperparameters
The model was trained using the Hugging Face Trainer. Key hyperparameters can be found in the training_config.json file in this repository.
- Precision: bfloat16 (
bf16) - Optimizer: AdamW
- Learning Rate: 2e-5
- Epochs: 3
- Effective Batch Size: 32
Training Results
The final validation loss for the best checkpoint was 2.6537.
How to Use
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "ReSearchX/pythia-70m-finetuned-alpaca-hindi"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
prompt_template = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
भारत की राजधानी क्या है?
### Response:
"""
input_ids = tokenizer(prompt_template, return_tensors="pt").input_ids.to(model.device)
outputs = model.generate(input_ids, max_new_tokens=50, do_sample=True, top_p=0.9, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 32
