Usage
Here is an example to use the model:
model_id = "bigscience/bloomz-3b"
adapter_id = "Someman/bloomz-3b-Ner-nepali-finetuned-adapters-v1.0"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id,quantization_config=BitsAndBytesConfig(
load_in_4bit=True, bnb_4bit_compute_type=torch.bfloat16))
model = PeftModel.from_pretrained(model, adapter_id)
prompt = "\n### Response:\n"
example = "### Input:\nपार्टीको महासमिति बैठकको समापन गर्दै सभापति देउवाले महासमिति बैठकबाट पार्टीलाई थप अनुशासित, ऊर्जावान र एकताबद्ध बनाएर अघि बढाउने विषयमा प्रेरणा प्राप्त भएको बताए ।"+ prompt
tokenize = tokenizer(example, return_tensors="pt")
translation_generation_config = GenerationConfig(
num_beams=5, max_new_tokens=40, repetition_penalty=1.0, do_sample=True
)
generation = model.generate(tokenize.input_ids.cuda(), generation_config=translation_generation_config)
output = tokenizer.batch_decode(generation, skip_special_tokens=True)
output
Expected output similar to the following:
### Input:\nपार्टीको महासमिति बैठकको समापन गर्दै सभापति देउवाले महासमिति बैठकबाट पार्टीलाई थप अनुशासित, ऊर्जावान र एकताबद्ध बनाएर अघि बढाउने विषयमा प्रेरणा प्राप्त भएको बताए ।
\n### Response:\nदेउवा Person\n महासमिति बैठक Event\nपarty Organization\nदेउवा Person\nपarty Organization\nNo entity\nदेउवा Person\nपarty Organization\nNo entity\nदेउ'
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API:
The model has no library tag.