Instructions to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java") model = AutoModelForCausalLM.from_pretrained("fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java
- SGLang
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java 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 "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java with Docker Model Runner:
docker model run hf.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java
ClearTrans 3B SFT: Go to Java
Built with Qwen.
This repository releases a full, direction-specific supervised fine-tuning (SFT) checkpoint based on Qwen/Qwen2.5-Coder-3B. Its translation direction is Go to Java.
Release scope
This checkpoint is provided as part of the ClearTrans artifact release. The available checkpoint metadata identifies the training stage as SFT. It does not establish that this is a final GRPO-trained checkpoint, and no specific manuscript benchmark score is attributed to this checkpoint here. The release has passed file-size, tensor-layout, and shard-index checks; GPU inference and benchmark reproduction have not been validated for this release.
Implementation and replication scripts: https://github.com/Xingzhehu/ClearTrans.
Loading
The training metadata records Transformers 4.57.1 and PyTorch 2.9.1. Use a compatible Transformers version and an environment suitable for the hardware.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Java"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype="auto", device_map="auto"
)
model.eval()
The tokenizer and the checkpoint's chat template are included. For reproduction, use the original task prompt and decoding configuration for the experiment being reproduced. The loading example alone does not specify a benchmark protocol.
Training metadata
The following settings are copied from the checkpoint's training-generated model card. They document the supplied checkpoint rather than a newly executed training run.
- learning_rate: 1e-05
- train_batch_size: 1
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 8
- gradient_accumulation_steps: 8
- total_train_batch_size: 64
- total_eval_batch_size: 64
- optimizer: Use adamw_torch_fused with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- num_epochs: 3.0
The original card identifies a direction-specific train_full_1231_go2java_idx3
dataset. Training examples are not included in this model repository; its name
alone does not verify the dataset provenance or reconstruction procedure.
Limitations
Generated translations can contain functional errors and code smells. Evaluate outputs with the intended tests and analysis tools before relying on them. This repository does not include training data, optimizer states, or historical evaluation outputs. It is a weight release, not evidence of full numerical reproduction of all reported experiments.
License and changes
The weights are released under the upstream Qwen Research License Agreement, included in LICENSE, for non-commercial research or evaluation in accordance with that agreement. They are not relicensed under MIT or Apache-2.0. See NOTICE for attribution and the statement of modifications.
The model weights were modified by full supervised fine-tuning of the upstream Qwen2.5-Coder-3B model. The supplied configuration and tokenizer files are retained from the training export; this release replaces the automatically generated model card and adds release documentation, the upstream license, and attribution notices.
- Downloads last month
- -