Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- translation
|
5 |
+
- opus-mt
|
6 |
+
- ctranslate2
|
7 |
+
- quantized
|
8 |
+
language:
|
9 |
+
- multilingual
|
10 |
+
pipeline_tag: translation
|
11 |
+
---
|
12 |
+
|
13 |
+
# opus-mt-yap-sv-ctranslate2-android
|
14 |
+
|
15 |
+
This is a quantized INT8 version of `Helsinki-NLP/opus-mt-yap-sv` converted to CTranslate2 format for efficient inference.
|
16 |
+
|
17 |
+
## Model Details
|
18 |
+
|
19 |
+
- **Original Model**: Helsinki-NLP/opus-mt-yap-sv
|
20 |
+
- **Format**: CTranslate2
|
21 |
+
- **Quantization**: INT8
|
22 |
+
- **Framework**: OPUS-MT
|
23 |
+
- **Converted by**: Automated conversion pipeline
|
24 |
+
|
25 |
+
## Usage
|
26 |
+
|
27 |
+
### With CTranslate2
|
28 |
+
|
29 |
+
```python
|
30 |
+
import ctranslate2
|
31 |
+
import sentencepiece as spm
|
32 |
+
|
33 |
+
# Load the model
|
34 |
+
translator = ctranslate2.Translator("path/to/model")
|
35 |
+
|
36 |
+
# Load tokenizers
|
37 |
+
sp_source = spm.SentencePieceProcessor(model_file="source.spm")
|
38 |
+
sp_target = spm.SentencePieceProcessor(model_file="target.spm")
|
39 |
+
|
40 |
+
# Translate
|
41 |
+
source_tokens = sp_source.encode("Your text here", out_type=str)
|
42 |
+
results = translator.translate_batch([source_tokens])
|
43 |
+
translation = sp_target.decode(results[0].hypotheses[0])
|
44 |
+
```
|
45 |
+
|
46 |
+
## Performance
|
47 |
+
|
48 |
+
This INT8 quantized version provides:
|
49 |
+
- ~75% reduction in model size
|
50 |
+
- Faster inference speed
|
51 |
+
- Maintained translation quality
|
52 |
+
- Mobile-friendly deployment
|
53 |
+
|
54 |
+
## Original Model
|
55 |
+
|
56 |
+
Based on the OPUS-MT project: https://github.com/Helsinki-NLP/Opus-MT
|