File size: 2,454 Bytes
ff96bc4
 
afbee2f
 
 
 
 
 
 
 
 
 
ff96bc4
 
afbee2f
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
afbee2f
 
 
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
afbee2f
 
 
 
 
 
ff96bc4
afbee2f
 
ff96bc4
afbee2f
 
 
 
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
 
 
afbee2f
ff96bc4
 
 
afbee2f
ff96bc4
afbee2f
 
ff96bc4
afbee2f
 
ff96bc4
afbee2f
 
ff96bc4
 
 
afbee2f
ff96bc4
afbee2f
 
ff96bc4
afbee2f
 
ff96bc4
afbee2f
 
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
afbee2f
ff96bc4
 
 
afbee2f
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
76
77
78
79
80
81
82
83
84
85
86
87
88
---
library_name: transformers
license: apache-2.0
datasets:
- billingsmoore/tibetan-to-english-translation-dataset
language:
- bo
- en
metrics:
- bleu
base_model:
- billingsmoore/tibetan-to-english-translation
---

# Model Card for tibetan-to-english-translation-4bit

## Model Details

This model is a quantized version of [**billingsmoore/tibetan-to-english-translation**](https://huggingface.co/billingsmoore/tibetan-to-english-translation). The model is double quanitized to 4bits. The process was performed (and can be replicated) with the following code:

```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, BitsAndBytesConfig
import torch

model_id = "billingsmoore/tibetan-to-english-translation"

tokenizer = AutoTokenizer.from_pretrained(model_id)

quantization_config =  BitsAndBytesConfig(
   load_in_4bit=True,
   bnb_4bit_quant_type="nf4",
   bnb_4bit_use_double_quant=True,
   bnb_4bit_compute_dtype=torch.bfloat16
)

model = AutoModelForSeq2SeqLM.from_pretrained(model_id, device_map="auto", quantization_config=quantization_config)
```

- **Developed by:** billingsmoore
- **Model type:** Seq2Seq
- **Language(s) (NLP):** Tibetan, English
- **License:** Apache license 2.0

### Model Sources 

- **Repository:** [GitHub](https://github.com/billingsmoore/MLotsawa)

## Uses

The intended usage of this quantized model is for in-browser usage on edge devices.

### Direct Use

This model can be used as part of a web app using Transformers.js as below.

```js
import { pipeline } from '@huggingface/transformers';

// Allocate a pipeline for sentiment-analysis
const pipe = await pipeline('translation', 'billingsmoore/tibetan-to-english-translation-4bit');

const out = await pipe('ན་མོ་མཉྫ་ཤཱི་ཡེ།');
```

### Out-of-Scope Use

This model can also be used in the usual way using the Python transformers library as below.

```python
from transformers import pipeline

# Allocate a pipeline for sentiment-analysis
pipe = pipeline('translation', 'billingsmoore/tibetan-to-english-translation-4bit')

out = pipe('ན་མོ་མཉྫ་ཤཱི་ཡེ།')
```

## More Information

For additional information on training, data, etc. please see the model card for [**billingsmoore/tibetan-to-english-translation**](https://huggingface.co/billingsmoore/tibetan-to-english-translation).

## Model Card Author

billingsmoore

## Model Card Contact

billingsmoore [at] gmail [dot] com