Text Generation
Transformers
Safetensors
qwen2
code
code-translation
cleartrans
sft
llama-factory
conversational
text-generation-inference
Instructions to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python 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-Python 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-Python") 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-Python") model = AutoModelForCausalLM.from_pretrained("fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python", 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-Python 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-Python" # 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-Python", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python
- SGLang
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python 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-Python" \ --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-Python", "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-Python" \ --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-Python", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python with Docker Model Runner:
docker model run hf.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python
|
Download README.md from fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python: direct link, hf CLI and curl.
- Browser
- Download file 3.8 kB
-
https://huggingface.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python/resolve/main/README.md
- Command line
-
hf download hf://fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python/README.md
-
curl -L -o README.md https://huggingface.co/fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python/resolve/main/README.md
3.8 kB
| library_name: transformers | |
| license: other | |
| license_name: qwen-research | |
| license_link: LICENSE | |
| base_model: Qwen/Qwen2.5-Coder-3B | |
| base_model_relation: finetune | |
| pipeline_tag: text-generation | |
| tags: | |
| - code | |
| - code-translation | |
| - cleartrans | |
| - sft | |
| - qwen2 | |
| - llama-factory | |
| # ClearTrans 3B SFT: Go to Python | |
| Built with Qwen. | |
| This repository releases a full, direction-specific supervised fine-tuning (SFT) | |
| checkpoint based on [Qwen/Qwen2.5-Coder-3B](https://huggingface.co/Qwen/Qwen2.5-Coder-3B). | |
| Its translation direction is **Go to Python**. | |
| ## 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](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. | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "fdsffjdkf/ClearTrans-3B-SFT-Go-to-Python" | |
| 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_go2python_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](LICENSE), for non-commercial research or evaluation in | |
| accordance with that agreement. They are not relicensed under MIT or Apache-2.0. | |
| See [NOTICE](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. | |