Downloads · 30 days
41
12% of all-time downloads
none000L4/nepali_japanese
nepali_japanese is a translation model from none000L4. Use it when you need text moved from one language to another. The card lists the license as mit.
Downloads · 30 days
41
12% of all-time downloads
All-time downloads
343
Public
Repo size
20.5 MB
Likes
1
Public
Click a slice to open those files.
.tflite9.2 MB · 48%
From the Hugging Face model README
Ja-Ne Tiny-Translate is an ultra-lightweight, bi-directional (Japanese ⇄ Nepali) translation model optimized for mobile and edge devices. It runs 100% offline. This model represents the Phase 1 milestone, built completely from scratch using a custom architecture and datasets.
Compared to large cloud APIs and heavy desktop models, this model is built for fast local CPU execution:
| Feature | 💡 Ja-Ne Tiny-Translate | 🌐 Cloud Translation APIs | 🦖 Massive Translation Models |
|---|---|---|---|
| Size | 8.23 MB (Ultra-compact) | N/A (Cloud-dependent) | 1.2 GB to 5.0 GB |
| Offline | 100% Offline (Zero latency) | Requires Internet | Requires massive GPU/RAM |
| Speed (CPU) | ~50 ms / sentence | Network dependent (300ms+) | Extremely slow on mobile CPU |
| Privacy | Absolute (No data leaks) | Sends data to cloud servers | Local (safe but heavy) |
This project is created and maintained by SPDHRD.
Ja-Ne Tiny-Translate は、スマートフォンやエッジデバイス上で高速かつ完全にオフラインで動作させるために開発された、日本語 ⇄ ネパール語 双方向翻訳特化の超軽量モデルです。 本モデルは、独自のアーキテクチャ設計とコーパスを用いてSPDHRDによってスクラッチ(ゼロ)から開発された第一段階(Phase 1)の記念碑的モデルです。
モバイル端末のCPU上で圧倒的な高速・軽量性を誇ります:
| 評価項目 | 💡 本モデル (Ja-Ne Tiny-Translate) | 🌐 クラウド翻訳API (Google等) | 🦖 巨大ローカルモデル (NLLB等) |
|---|---|---|---|
| サイズ | 8.23 MB (超軽量) | 不要 (通信が必要) | 1.2 GB 〜 5.0 GB (巨大) |
| オフライン | 完全オフライン動作可能 | インターネット接続が必須 | 高性能GPUと大容量メモリが必須 |
| 推論速度 (CPU) | 約 50 ms / 文 (超低遅延) | 動作環境に依存 (300ms以上) | モバイルCPU上では実用不可レベル |
| プライバシー | 極めて安全 (漏洩リスクゼロ) | クラウドへのテキスト送信必須 | 安全 (ローカル実行) |
本プロジェクトは SPDHRD によって設計・開発・運営されています。
Ja-Ne Tiny-Translate मोबाइल र अन्य साना उपकरणहरूमा छिटो र पूर्ण रूपमा अफलाइन चलाउनको लागि अनुकूलित गरिएको जापानी र नेपाली (Japanese ⇄ Nepali) दुई-तर्फी अनुवाद मोडेल हो।
यो मोडेल SPDHRD द्वारा पूर्ण रूपमा शून्य (scratch) बाट विकास गरिएको पहिलो चरण (Phase 1) को एक महत्त्वपूर्ण माइलस्टोन मोडेल हो।
ठूला क्लाउड API वा भारी डेस्कटप मोडेलहरूको तुलनामा, यो मोडेल मोबाइलको सामान्य CPU मा पनि अत्यन्तै द्रुत गतिमा चल्छ:
| विशेषता | 💡 यो मोडेल (Ja-Ne Tiny-Translate) | 🌐 क्लाउड अनुवाद API हरू | 🦖 ठूला स्थानीय मोडेलहरू (NLLB आदि) |
|---|---|---|---|
| साइज | ८.२३ MB (अति हलुका र सानो) | चाहिँदैन (इन्टरनेट आवश्यक) | १.२ GB देखि ५.० GB |
| अफलाइन | १००% अफलाइन कार्य | इन्टरनेटको आवश्यकता | उच्च GPU/RAM आवश्यक |
| गति (CPU) | ~५० मिलिसेकेन्ड / प्रति वाक्य | नेटवर्कमा निर्भर (३००ms+) | मोबाइलको CPU मा अत्यन्तै ढिलो |
| गोपनीयता | पूर्ण सुरक्षित (डाटा बाहिर जाँदैन) | डाटा सर्भरमा पठाउनुपर्ने | स्थानीय (सुरक्षित तर भारी) |
यो परियोजना SPDHRD द्वारा सिर्जना र व्यवस्थित गरिएको हो।
Measured on a single CPU thread (Average sequence length: ~5.5 tokens)
First, install dependencies:
pip install sentencepiece numpy onnxruntime
import numpy as np
import sentencepiece as spm
import onnxruntime as ort
# 1. Load Tokenizer & ONNX Model
sp = spm.SentencePieceProcessor(model_file="tokenizer.model")
session = ort.InferenceSession("model.onnx")
def pad_sequence(seq, max_len=128, pad_val=0):
if len(seq) > max_len:
return seq[:max_len]
return seq + [pad_val] * (max_len - len(seq))
def translate(text, direction="ja2ne"):
# Assign tags and branch IDs
if direction == "ja2ne":
tag, tid = "<JA2NE>", 0
elif direction == "ne2ja":
tag, tid = "<NE2JA>", 1
else:
raise ValueError("Invalid direction. Choose 'ja2ne' or 'ne2ja'.")
# Encode prompt
prompt = f"{tag} {text}"
tokens = sp.encode(prompt)
x_padded = pad_sequence(tokens, max_len=128)
x_in = np.array([x_padded], dtype=np.int32)
tid_in = np.array([tid], dtype=np.int32)
# Autoregressive generation
tgt_tokens = []
for _ in range(128):
dec_input = [sp.bos_id()] + tgt_tokens
dec_padded = pad_sequence(dec_input, max_len=128)
dec_in = np.array([dec_padded], dtype=np.int32)
# Run inference using ONNX session
outputs = session.run(None, {
"x": x_in,
"tgt": dec_in,
"tid": tid_in
})
logits = outputs[0]
current_pos = len(dec_input) - 1
next_token = int(np.argmax(logits[0, current_pos, :]))
if next_token == sp.eos_id():
break
tgt_tokens.append(next_token)
return sp.decode(tgt_tokens)
# Try Bi-directional Translation
print("JA to NE:", translate("株式取引は、リスクの高い投資です。", direction="ja2ne"))
print("NE to JA:", translate("मलाई भोक लाग्यो।", direction="ne2ja"))