File size: 1,965 Bytes
07ca351
2df3cbc
 
 
e2dc57c
52682fa
2df3cbc
52682fa
 
 
 
07ca351
 
 
 
 
 
 
 
 
 
 
11a59de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616829f
11a59de
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
license: llama3
language:
- ne
library_name: transformers
base_model: unsloth/llama-3-8b-bnb-4bit
tags:
- unsloth
- pytorch
- llama-3
- conversational
---

This model is the initial test version, finetuned using LLaMA-3-8B version provided by UnslothAI in Nepali Language.

## Model Details

Directly quantized 4bit model with bitsandbytes. Built with Meta Llama 3. By UnslothAI.

- **Developed by:** Norden Ghising Tamang under DarviLab Pvt. Ltd
- **Model type:** Transformer-based language model
- **Language(s) (NLP):** Nepali
- **License:** A custom commercial license is available at: https://llama.meta.com/llama3/license

## How To Use

### Using HuggingFace's AutoModelForPeftCausalLM

```python
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained(
    "nordenxgt/nelm-chat-unsloth-llama3-v.0.0.1"
    load_in_4bit=True
)
tokenizer = AutoTokenizer.from_pretrained("nordenxgt/nelm-chat-unsloth-llama3-v.0.0.1")
```

### Using UnslothAI [x2 Faster Inference]

```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="nordenxgt/nelm-chat-unsloth-llama3-v.0.0.1",
    max_seq_length=2048,
    dtype=None,
    load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
```

```python
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
{}

### Input:
{}

### Response:
{}"""

inputs = tokenizer(
[
    alpaca_prompt.format(
        "गौतम बुद्धको जन्म कुन देशमा भएको थियो?"  # instruction
        "", # input
        "", # output - leave this blank for generation!
    )
], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
tokenizer.batch_decode(outputs)
```