Instructions to use dawon62/hkcode-mt-en-ko with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dawon62/hkcode-mt-en-ko with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dawon62/hkcode-mt-en-ko")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dawon62/hkcode-mt-en-ko") model = AutoModelForCausalLM.from_pretrained("dawon62/hkcode-mt-en-ko", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dawon62/hkcode-mt-en-ko with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dawon62/hkcode-mt-en-ko" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dawon62/hkcode-mt-en-ko", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dawon62/hkcode-mt-en-ko
- SGLang
How to use dawon62/hkcode-mt-en-ko with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dawon62/hkcode-mt-en-ko" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dawon62/hkcode-mt-en-ko", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dawon62/hkcode-mt-en-ko" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dawon62/hkcode-mt-en-ko", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dawon62/hkcode-mt-en-ko with Docker Model Runner:
docker model run hf.co/dawon62/hkcode-mt-en-ko
Upload MarianForCausalLM
Browse files- config.json +6 -27
- generation_config.json +1 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -6,11 +6,6 @@
|
|
| 6 |
"MarianForCausalLM"
|
| 7 |
],
|
| 8 |
"attention_dropout": 0.0,
|
| 9 |
-
"bad_words_ids": [
|
| 10 |
-
[
|
| 11 |
-
32000
|
| 12 |
-
]
|
| 13 |
-
],
|
| 14 |
"bos_token_id": 0,
|
| 15 |
"classifier_dropout": 0.0,
|
| 16 |
"d_model": 1024,
|
|
@@ -26,38 +21,22 @@
|
|
| 26 |
"encoder_layerdrop": 0.0,
|
| 27 |
"encoder_layers": 6,
|
| 28 |
"eos_token_id": 2,
|
| 29 |
-
"forced_eos_token_id":
|
| 30 |
"init_std": 0.02,
|
| 31 |
"is_decoder": true,
|
| 32 |
"is_encoder_decoder": false,
|
| 33 |
-
"max_length":
|
| 34 |
"max_position_embeddings": 1024,
|
| 35 |
"model_type": "marian",
|
| 36 |
"normalize_embedding": false,
|
| 37 |
-
"num_beams":
|
| 38 |
"num_hidden_layers": 6,
|
| 39 |
"pad_token_id": 32000,
|
| 40 |
-
"pretraining_tp": 1,
|
| 41 |
-
"quantization_config": {
|
| 42 |
-
"_load_in_4bit": true,
|
| 43 |
-
"_load_in_8bit": false,
|
| 44 |
-
"bnb_4bit_compute_dtype": "float16",
|
| 45 |
-
"bnb_4bit_quant_storage": "uint8",
|
| 46 |
-
"bnb_4bit_quant_type": "nf4",
|
| 47 |
-
"bnb_4bit_use_double_quant": false,
|
| 48 |
-
"llm_int8_enable_fp32_cpu_offload": false,
|
| 49 |
-
"llm_int8_has_fp16_weight": false,
|
| 50 |
-
"llm_int8_skip_modules": null,
|
| 51 |
-
"llm_int8_threshold": 6.0,
|
| 52 |
-
"load_in_4bit": true,
|
| 53 |
-
"load_in_8bit": false,
|
| 54 |
-
"quant_method": "bitsandbytes"
|
| 55 |
-
},
|
| 56 |
"scale_embedding": true,
|
| 57 |
"share_encoder_decoder_embeddings": true,
|
| 58 |
"static_position_embeddings": true,
|
| 59 |
-
"torch_dtype": "
|
| 60 |
-
"transformers_version": "4.
|
| 61 |
-
"use_cache":
|
| 62 |
"vocab_size": 32001
|
| 63 |
}
|
|
|
|
| 6 |
"MarianForCausalLM"
|
| 7 |
],
|
| 8 |
"attention_dropout": 0.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"bos_token_id": 0,
|
| 10 |
"classifier_dropout": 0.0,
|
| 11 |
"d_model": 1024,
|
|
|
|
| 21 |
"encoder_layerdrop": 0.0,
|
| 22 |
"encoder_layers": 6,
|
| 23 |
"eos_token_id": 2,
|
| 24 |
+
"forced_eos_token_id": null,
|
| 25 |
"init_std": 0.02,
|
| 26 |
"is_decoder": true,
|
| 27 |
"is_encoder_decoder": false,
|
| 28 |
+
"max_length": null,
|
| 29 |
"max_position_embeddings": 1024,
|
| 30 |
"model_type": "marian",
|
| 31 |
"normalize_embedding": false,
|
| 32 |
+
"num_beams": null,
|
| 33 |
"num_hidden_layers": 6,
|
| 34 |
"pad_token_id": 32000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
"scale_embedding": true,
|
| 36 |
"share_encoder_decoder_embeddings": true,
|
| 37 |
"static_position_embeddings": true,
|
| 38 |
+
"torch_dtype": "float16",
|
| 39 |
+
"transformers_version": "4.45.1",
|
| 40 |
+
"use_cache": true,
|
| 41 |
"vocab_size": 32001
|
| 42 |
}
|
generation_config.json
CHANGED
|
@@ -12,5 +12,5 @@
|
|
| 12 |
"num_beams": 4,
|
| 13 |
"pad_token_id": 32000,
|
| 14 |
"renormalize_logits": true,
|
| 15 |
-
"transformers_version": "4.
|
| 16 |
}
|
|
|
|
| 12 |
"num_beams": 4,
|
| 13 |
"pad_token_id": 32000,
|
| 14 |
"renormalize_logits": true,
|
| 15 |
+
"transformers_version": "4.45.1"
|
| 16 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88bf4c1f4b4dccb35fa2acfe6a4a39e3d3b5f49efb5ab3247fe734e2f641e38b
|
| 3 |
+
size 275512400
|