Views
No views yet
| 基底模型 | unsloth/phi-4-unsloth-bnb-4bit |
| 架構 | LlamaForCausalLM(Phi-4 via Unsloth) |
| 參數量 | ~14B |
| 精度 | bfloat16 |
| 最大 Context 長度 | 16,384 tokens |
| 訓練方式 | 監督式微調(SFT)+ LoRA |
| 框架 | Unsloth + HuggingFace TRL |
| 任務 | OpenDRIVE 路網生成 |
| 輸入語言 | 英文、繁體中文 |
| 授權 | MIT |
| LoRA rank | 128 |
| LoRA alpha | 128 |
| LoRA dropout | 0.0 |
| 目標模組 | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| 訓練步數 | 300 步(約 1 epoch) |
| 最高學習率 | 2e-4 |
| 最終訓練 loss | ~0.54 |
You are an OpenDRIVE road network generator that accepts descriptions in English or Traditional Chinese (繁體中文). Output valid OpenDRIVE XML (.xodr) following the 1.4/1.5 specification, with proper header, roads with planView geometry, lane sections, and junction definitions where needed.
你是一個 OpenDRIVE 路網生成器,可接受英文或繁體中文描述。請輸出符合 OpenDRIVE 1.4/1.5 規範的合法 .xodr XML,包含正確的 header、含 planView 幾何的 roads、車道區段,以及必要的 junction 定義。Generate a small road cluster suitable for autonomous driving simulation.
The network should have roughly 4 roads with about 0 junctions.
Total road length should be around 320 m.
Roads should have one lane per direction.
Include sidewalks along the roads.
Road geometry should be mostly straight with minimal curves.請以 OpenDRIVE (.xodr) 格式生成一個路網,包含 1 條道路與 1 個路口,總長度 136 公尺。請輸出合法的 OpenDRIVE XML。<|im_sep|> 作為角色分隔符:<|im_start|>system<|im_sep|>
{system prompt}<|im_end|>
<|im_start|>user<|im_sep|>
{路網描述}<|im_end|>
<|im_start|>assistant<|im_sep|>transformers1import transformers
2
3pipeline = transformers.pipeline(
4 "text-generation",
5 model="./Heliars-Carla-X1",
6 model_kwargs={"torch_dtype": "auto"},
7 device_map="auto",
8)
9
10SYSTEM_PROMPT = (
11 "You are an OpenDRIVE road network generator that accepts descriptions in English or "
12 "Traditional Chinese (繁體中文). Output valid OpenDRIVE XML (.xodr) following the 1.4/1.5 "
13 "specification, with proper header, roads with planView geometry, lane sections, and "
14 "junction definitions where needed.\n\n"
15 "你是一個 OpenDRIVE 路網生成器,可接受英文或繁體中文描述。請輸出符合 OpenDRIVE 1.4/1.5 規範的合法 "
16 ".xodr XML,包含正確的 header、含 planView 幾何的 roads、車道區段,以及必要的 junction 定義。"
17)
18
19messages = [
20 {"role": "system", "content": SYSTEM_PROMPT},
21 {"role": "user", "content": "請生成一個住宅區路網,4 條道路、無路口,總長約 320 公尺,每方向一車道,含人行道。"},
22]
23
24outputs = pipeline(messages, max_new_tokens=4096)
25print(outputs[0]["generated_text"][-1]["content"])1from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
4
5response = client.chat.completions.create(
6 model="Heliars-Carla-X1",
7 messages=[
8 {"role": "system", "content": SYSTEM_PROMPT},
9 {"role": "user", "content": "請生成一個包含 3 條道路、1 個路口的路網,總長度約 250 公尺。"},
10 ],
11 max_tokens=4096,
12 temperature=0.1,
13)
14print(response.choices[0].message.content).xodr 檔案。