Instructions to use Cognitive-Lab/Ambari-7B-Instruct-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Cognitive-Lab/Ambari-7B-Instruct-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Cognitive-Lab/Ambari-7B-Instruct-v0.1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Cognitive-Lab/Ambari-7B-Instruct-v0.1") model = AutoModelForCausalLM.from_pretrained("Cognitive-Lab/Ambari-7B-Instruct-v0.1") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Cognitive-Lab/Ambari-7B-Instruct-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Cognitive-Lab/Ambari-7B-Instruct-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Cognitive-Lab/Ambari-7B-Instruct-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Cognitive-Lab/Ambari-7B-Instruct-v0.1
- SGLang
How to use Cognitive-Lab/Ambari-7B-Instruct-v0.1 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 "Cognitive-Lab/Ambari-7B-Instruct-v0.1" \ --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": "Cognitive-Lab/Ambari-7B-Instruct-v0.1", "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 "Cognitive-Lab/Ambari-7B-Instruct-v0.1" \ --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": "Cognitive-Lab/Ambari-7B-Instruct-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Cognitive-Lab/Ambari-7B-Instruct-v0.1 with Docker Model Runner:
docker model run hf.co/Cognitive-Lab/Ambari-7B-Instruct-v0.1
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Cognitive-Lab/Ambari-7B-Instruct-v0.1")# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Cognitive-Lab/Ambari-7B-Instruct-v0.1")
model = AutoModelForCausalLM.from_pretrained("Cognitive-Lab/Ambari-7B-Instruct-v0.1")Ambari-7B-Instruct-v0.1
Overview
Ambari-7B-Instruct-v0.1 is an extension of the Ambari series, a bilingual English/Kannada model developed and released by Cognitivelab.in. This model is specialized for natural language understanding tasks, particularly in the context of instructional pairs. It is built upon the Ambari-7B-Base-v0.1 model, utilizing a fine-tuning process with a curated dataset of translated instructional pairs.
Usage
To use the Ambari-7B-Instruct-v0.1 model, you can follow the example code below:
# Usage
import torch
from transformers import LlamaTokenizer, LlamaForCausalLM
model = LlamaForCausalLM.from_pretrained('Cognitive-Lab/Ambari-7B-Instruct-v0.1')
tokenizer = LlamaTokenizer.from_pretrained('Cognitive-Lab/Ambari-7B-Instruct-v0.1')
prompt = "Give me 10 Study tips in Kannada."
inputs = tokenizer(prompt, return_tensors="pt")
# Generate
generate_ids = model.generate(inputs.input_ids, max_length=1000)
decoded_output = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
print(decoded_output)
Learn More
Read more about Ambari-7B-Instruct-v0.1 and its applications in natural language understanding tasks on the Cognitivelab.in blog.
Dataset Information
The model is fine-tuned using the Kannada Instruct Dataset, a collection of translated instructional pairs. The dataset includes English instruction and output pairs, as well as their corresponding translations in Kannada. The intentional diversification of the dataset, encompassing various language combinations, enhances the model's proficiency in cross-lingual tasks.
Bilingual Instruct Fine-tuning
The model underwent a pivotal stage of supervised fine-tuning with low-rank adaptation, focusing on bilingual instruct fine-tuning. This approach involved training the model to respond adeptly in either English or Kannada based on the language specified in the user prompt or instruction.
References
- Downloads last month
- 25
# Gated model: Login with a HF token with gated access permission hf auth login