Text Generation
Transformers
Safetensors
English
qwen2
code
cobol
code-documentation
qwen
qwen2.5
instruction-tuning
llm
generative-model
conversational
text-generation-inference
Instructions to use V7W3D/qwen-code-doc-ft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use V7W3D/qwen-code-doc-ft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="V7W3D/qwen-code-doc-ft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("V7W3D/qwen-code-doc-ft") model = AutoModelForCausalLM.from_pretrained("V7W3D/qwen-code-doc-ft") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use V7W3D/qwen-code-doc-ft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "V7W3D/qwen-code-doc-ft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "V7W3D/qwen-code-doc-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/V7W3D/qwen-code-doc-ft
- SGLang
How to use V7W3D/qwen-code-doc-ft 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 "V7W3D/qwen-code-doc-ft" \ --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": "V7W3D/qwen-code-doc-ft", "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 "V7W3D/qwen-code-doc-ft" \ --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": "V7W3D/qwen-code-doc-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use V7W3D/qwen-code-doc-ft with Docker Model Runner:
docker model run hf.co/V7W3D/qwen-code-doc-ft
Qwen2.5-Coder-3B-Instruct – Fine-tuned for COBOL Code Documentation
This model is a fine-tuned version of Qwen/Qwen2.5-Coder-3B-Instruct, optimized for generating natural language documentation from COBOL source code. The fine-tuning was done using freeze fine-tuning on the last transformer layer only, preserving the rest of the model's pretrained weights.
🔧 Model Description
- Architecture: Qwen2.5-Coder-3B (decoder-only transformer)
- Base Model: Qwen/Qwen2.5-Coder-3B-Instruct
- Fine-tuning Method: Freeze fine-tuning (only last transformer block's parameters were updated)
- Training Objective: Instruction-following text generation for COBOL code documentation
🧠 Use Cases
This model is specialized in generating descriptive documentation for legacy COBOL code, especially useful for:
- Legacy system maintenance
- Automated codebase documentation
- Migration planning
- COBOL code understanding and onboarding
✍️ Example Usage
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_name = "V7W3D/qwen-code-doc-ft"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
doc_gen = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "### Document this COBOL code:\n\n IDENTIFICATION DIVISION.\n PROGRAM-ID. HELLO-WORLD.\n PROCEDURE DIVISION.\n DISPLAY 'HELLO, WORLD!'\n STOP RUN.\n\n### Documentation:"
response = doc_gen(prompt, max_new_tokens=200, do_sample=False)
print(response[0]["generated_text"])
- Downloads last month
- 2