Downloads · 30 days
61
3% of all-time downloads
asif00/bangla-llama-1B-gguf-16bit
bangla-llama-1B-gguf-16bit is a question answering model from asif00. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as apache-2.0.
Bangla LLaMA GGUF is a 1-billion-parameter language model optimized for Bengali-language tasks such as context-based question answering and retrieval-augmented generation. It is derived from LLaMA 3.2 1B and trained o…
Downloads · 30 days
61
3% of all-time downloads
All-time downloads
2.4K
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB · 100%
From the Hugging Face model README
Bangla LLaMA GGUF is a 1-billion-parameter language model optimized for Bengali-language tasks such as context-based question answering and retrieval-augmented generation. It is derived from LLaMA 3.2 1B and trained on the OdiaGenAI/all_combined_bengali_252k dataset.
llama.cpp and Hugging Face transformers (with conversion)llama.cppgit clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
make
./main -m path/to/asif00/bangla-llama-1B-gguf-16bit.gguf -p "আপনার প্রশ্ন এখানে"
Note: GGUF format is not directly supported by transformers. Conversion to a compatible format is required.
pip install transformers accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load tokenizer and model (after conversion)
tokenizer = AutoTokenizer.from_pretrained("asif00/bangla-llama-1B")
model = AutoModelForCausalLM.from_pretrained("path/to/converted-model")
prompt = """
নিচের নির্দেশনা বাংলা ভাষায় যা একটি কাজ বর্ণনা করে, এবং ইনপুটও বাংলা ভাষায় যা অতিরিক্ত প্রসঙ্গ প্রদান করে। উপযুক্তভাবে অনুরোধ পূরণ করে বাংলা ভাষায় একটি প্রতিক্রিয়া লিখুন।
### নির্দেশনা:
{}
### ইনপুট:
{}
### প্রতিক্রিয়া:
"""
def generate_response(instruction, context):
input_text = prompt.format(instruction, context)
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_length=512, eos_token_id=tokenizer.eos_token_id)
response = tokenizer.decode(output[0], skip_special_tokens=True)
response = response.split("### প্রতিক্রিয়া:")[-1].strip()
return response
# Example
instruction = "ভারতীয় বাঙালি কথাসাহিত্যিক মহাশ্বেতা দেবীর সম্পর্কে একটি সংক্ষিপ্ত বিবরণ দিন।"
context = "মহাশ্বেতা দেবী ২০১৬ সালে হৃদরোগে আক্রান্ত হয়ে কলকাতায় মৃত্যুবরণ করেন।"
print(generate_response(instruction, context))
question = "ভারতীয় বাঙালি কথাসাহিত্যিক মহাশ্বেতা দেবীর মৃত্যু কবে হয় ?"
context = (
"২০১৬ সালের ২৩ জুলাই হৃদরোগে আক্রান্ত হয়ে মহাশ্বেতা দেবী কলকাতার বেল ভিউ ক্লিনিকে ভর্তি হন। "
"সেই বছরই ২৮ জুলাই একাধিক অঙ্গ বিকল হয়ে তাঁর মৃত্যু ঘটে। তিনি মধুমেহ, সেপ্টিসেমিয়া ও মূত্র সংক্রমণ রোগেও ভুগছিলেন।"
)
answer = generate_response(question, context)
print("উত্তর:", answer)
Output:
উত্তর: মহাশ্বেতা দেবী ২৮ জুলাই ২০১৬ সালে মৃত্যুবরণ করেন।
The Bangla LLaMA GGUF model's performance is contingent on the quality and diversity of the training data. Users should verify the information generated, especially for critical applications.