Text Generation
Transformers
TensorBoard
Safetensors
Chinese
English
code
qwen
lora
repository-understanding
code-assistant
fine-tuning
multi-agent-systems
Eval Results (legacy)
Instructions to use tensense/code_repo_finetuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensense/code_repo_finetuning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensense/code_repo_finetuning")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensense/code_repo_finetuning", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tensense/code_repo_finetuning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensense/code_repo_finetuning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensense/code_repo_finetuning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tensense/code_repo_finetuning
- SGLang
How to use tensense/code_repo_finetuning 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 "tensense/code_repo_finetuning" \ --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": "tensense/code_repo_finetuning", "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 "tensense/code_repo_finetuning" \ --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": "tensense/code_repo_finetuning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tensense/code_repo_finetuning with Docker Model Runner:
docker model run hf.co/tensense/code_repo_finetuning
| """ | |
| 统一的路径管理模块 | |
| """ | |
| from pathlib import Path | |
| # 项目根目录 | |
| PROJECT_ROOT = Path(__file__).parent.parent | |
| # 配置文件路径 | |
| CONFIG_DIR = PROJECT_ROOT / "config" | |
| DEFAULT_CONFIG = CONFIG_DIR / "default_config.yaml" | |
| DEEPSPEED_CONFIG = CONFIG_DIR / "deepspeed_zero3.json" | |
| # 数据路径 | |
| DATA_DIR = PROJECT_ROOT / "data" | |
| REPO_ANALYSIS_FILE = DATA_DIR / "repository_analysis.json" | |
| TRAINING_DATA_DIR = DATA_DIR / "training_data" | |
| # 输出路径 | |
| OUTPUT_DIR = PROJECT_ROOT / "output" | |
| MODEL_OUTPUT_DIR = OUTPUT_DIR / "finetuned_model" | |
| # 仓库路径 | |
| REPOS_DIR = PROJECT_ROOT / "repos" | |
| def get_repo_path(repo_name: str) -> Path: | |
| """获取特定仓库路径""" | |
| return REPOS_DIR / repo_name |