初始化项目,由ModelHub XC社区提供模型
Model: zed-industries/zeta-2.1 Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||||
64
README.md
Normal file
64
README.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
base_model: ByteDance-Seed/Seed-Coder-8B-Base
|
||||||
|
tags:
|
||||||
|
- text-generation-inference
|
||||||
|
- transformers
|
||||||
|
- edit-prediction
|
||||||
|
- next-edit-suggestion
|
||||||
|
license: apache-2.0
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
---
|
||||||
|
|
||||||
|
# Zeta 2.1
|
||||||
|
|
||||||
|
Zeta 2.1 is a code edit prediction (also known as next-edit suggestion) model finetuned from `ByteDance-Seed/Seed-Coder-8B-Base`.
|
||||||
|
|
||||||
|
Given code context, edits history and an editable region around the cursor, it predicts the rewritten content for that region.
|
||||||
|
|
||||||
|
- **Developed by:** Zed Industries
|
||||||
|
- **License:** Apache-2.0
|
||||||
|
- **Fine-tuned from:** ByteDance-Seed/Seed-Coder-8B-Base
|
||||||
|
- **Model version:** 0323-multi-region-filtered-r3
|
||||||
|
|
||||||
|
## Prompt format
|
||||||
|
|
||||||
|
The model uses a SPM (suffix-prefix-middle) style prompt with numbered multi-region markers for editable regions:
|
||||||
|
|
||||||
|
|
||||||
|
Here is a minimal example:
|
||||||
|
|
||||||
|
```
|
||||||
|
<[fim-suffix]>
|
||||||
|
code after editable region
|
||||||
|
<[fim-prefix]><filename>related/file.py
|
||||||
|
related file content
|
||||||
|
|
||||||
|
<filename>edit_history
|
||||||
|
--- a/some_file.py
|
||||||
|
+++ b/some_file.py
|
||||||
|
-old
|
||||||
|
+new
|
||||||
|
|
||||||
|
<filename>path/to/target_file.py
|
||||||
|
code before editable region
|
||||||
|
<|marker_1|>
|
||||||
|
code that
|
||||||
|
needs to<|user_cursor|>
|
||||||
|
be rewritten
|
||||||
|
<|marker_2|>
|
||||||
|
<[fim-middle]>
|
||||||
|
```
|
||||||
|
|
||||||
|
Expected output (should be generated by the model, without backticks):
|
||||||
|
|
||||||
|
```
|
||||||
|
<|marker_1|>
|
||||||
|
revised content for
|
||||||
|
the editable region
|
||||||
|
<|marker_2|>
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is a real-world example:
|
||||||
|
- [Sample prompt input](./sample.prompt)
|
||||||
|
- [Sample model output](./sample.output)
|
||||||
33
config.json
Normal file
33
config.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"LlamaForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.1,
|
||||||
|
"bos_token_id": 0,
|
||||||
|
"torch_dtype": "bfloat16",
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"head_dim": 128,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 4096,
|
||||||
|
"initializer_range": 0.009882118,
|
||||||
|
"intermediate_size": 14336,
|
||||||
|
"layer_norm_eps": null,
|
||||||
|
"max_position_embeddings": 32768,
|
||||||
|
"mlp_bias": false,
|
||||||
|
"model_type": "llama",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_hidden_layers": 32,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"pad_token_id": 1,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"resid_pdrop": 0.1,
|
||||||
|
"rms_norm_eps": 1e-06,
|
||||||
|
"rope_scaling": null,
|
||||||
|
"rope_theta": 500000.0,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"transformers_version": "4.57.3",
|
||||||
|
"unsloth_version": "2026.1.3",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 155136
|
||||||
|
}
|
||||||
3
model-00001-of-00004.safetensors
Normal file
3
model-00001-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:cb82df7d66542e2b329a3f8029c561168afcc235082740c4290fe95685b266f8
|
||||||
|
size 4962001760
|
||||||
3
model-00002-of-00004.safetensors
Normal file
3
model-00002-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a3ad1dd0e3b8f3420225de60779befabada9385aac83c54503d5e67d9b9efe96
|
||||||
|
size 4915916160
|
||||||
3
model-00003-of-00004.safetensors
Normal file
3
model-00003-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:84549de401f30b1684c1504be9e9ec4f205f14c6bf724b24073c33737dc282fe
|
||||||
|
size 4999819336
|
||||||
3
model-00004-of-00004.safetensors
Normal file
3
model-00004-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:93dd7e354018fd22cd8573bc857aa16fdc520d3db1715b900523a25ada3af4e0
|
||||||
|
size 1623221024
|
||||||
298
model.safetensors.index.json
Normal file
298
model.safetensors.index.json
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
{
|
||||||
|
"metadata": {
|
||||||
|
"total_size": 16500924416
|
||||||
|
},
|
||||||
|
"weight_map": {
|
||||||
|
"lm_head.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.embed_tokens.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.19.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.21.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.22.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.31.input_layernorm.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.layers.31.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.layers.31.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.layers.31.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.layers.31.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
|
||||||
|
"model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
||||||
|
"model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
||||||
|
"model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
||||||
|
"model.norm.weight": "model-00004-of-00004.safetensors"
|
||||||
|
}
|
||||||
|
}
|
||||||
17
sample.output
Normal file
17
sample.output
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<|marker_1|> return;
|
||||||
|
};
|
||||||
|
let path = project.read(cx).path_for_entry(*active_entry_id, cx);
|
||||||
|
if let Some(path) = path {
|
||||||
|
if let Some(ix) = project_state
|
||||||
|
.recent_paths
|
||||||
|
.iter()
|
||||||
|
.position(|probe| probe == &path)
|
||||||
|
{
|
||||||
|
project_state.recent_paths.remove(ix);
|
||||||
|
}
|
||||||
|
project_state.recent_paths.push_front(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
project::Event::DiskBasedDiagnosticsFinished<|user_cursor|> { .. } => {
|
||||||
|
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||||
|
<|marker_2|>
|
||||||
368
sample.prompt
Normal file
368
sample.prompt
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
<[fim-suffix]>
|
||||||
|
<[fim-prefix]><filename>zed/crates/project/src/project.rs
|
||||||
|
pub struct Project {
|
||||||
|
active_entry: Option<ProjectEntryId>,
|
||||||
|
buffer_ordered_messages_tx: mpsc::UnboundedSender<BufferOrderedMessage>,
|
||||||
|
languages: Arc<LanguageRegistry>,
|
||||||
|
dap_store: Entity<DapStore>,
|
||||||
|
agent_server_store: Entity<AgentServerStore>,
|
||||||
|
|
||||||
|
breakpoint_store: Entity<BreakpointStore>,
|
||||||
|
collab_client: Arc<client::Client>,
|
||||||
|
join_project_response_message_id: u32,
|
||||||
|
task_store: Entity<TaskStore>,
|
||||||
|
user_store: Entity<UserStore>,
|
||||||
|
fs: Arc<dyn Fs>,
|
||||||
|
remote_client: Option<Entity<RemoteClient>>,
|
||||||
|
// todo lw explain the client_state x remote_client matrix, its super confusing
|
||||||
|
client_state: ProjectClientState,
|
||||||
|
git_store: Entity<GitStore>,
|
||||||
|
collaborators: HashMap<proto::PeerId, Collaborator>,
|
||||||
|
client_subscriptions: Vec<client::Subscription>,
|
||||||
|
worktree_store: Entity<WorktreeStore>,
|
||||||
|
buffer_store: Entity<BufferStore>,
|
||||||
|
context_server_store: Entity<ContextServerStore>,
|
||||||
|
image_store: Entity<ImageStore>,
|
||||||
|
lsp_store: Entity<LspStore>,
|
||||||
|
_subscriptions: Vec<gpui::Subscription>,
|
||||||
|
buffers_needing_diff: HashSet<WeakEntity<Buffer>>,
|
||||||
|
git_diff_debouncer: DebouncedDelay<Self>,
|
||||||
|
remotely_created_models: Arc<Mutex<RemotelyCreatedModels>>,
|
||||||
|
terminals: Terminals,
|
||||||
|
node: Option<NodeRuntime>,
|
||||||
|
search_history: SearchHistory,
|
||||||
|
search_included_history: SearchHistory,
|
||||||
|
search_excluded_history: SearchHistory,
|
||||||
|
snippets: Entity<SnippetProvider>,
|
||||||
|
environment: Entity<ProjectEnvironment>,
|
||||||
|
settings_observer: Entity<SettingsObserver>,
|
||||||
|
toolchain_store: Option<Entity<ToolchainStore>>,
|
||||||
|
agent_location: Option<AgentLocation>,
|
||||||
|
downloading_files: Arc<Mutex<HashMap<(WorktreeId, String), DownloadingFile>>>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
pub enum Event {
|
||||||
|
LanguageServerAdded(LanguageServerId, LanguageServerName, Option<WorktreeId>),
|
||||||
|
LanguageServerRemoved(LanguageServerId),
|
||||||
|
LanguageServerLog(LanguageServerId, LanguageServerLogType, String),
|
||||||
|
...
|
||||||
|
LanguageServerBufferRegistered {
|
||||||
|
server_id: LanguageServerId,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
ToggleLspLogs {
|
||||||
|
server_id: LanguageServerId,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
Toast {
|
||||||
|
notification_id: SharedString,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
HideToast {
|
||||||
|
notification_id: SharedString,
|
||||||
|
},
|
||||||
|
LanguageServerPrompt(LanguageServerPromptRequest),
|
||||||
|
LanguageNotFound(Entity<Buffer>),
|
||||||
|
ActiveEntryChanged(Option<ProjectEntryId>),
|
||||||
|
ActivateProjectPanel,
|
||||||
|
WorktreeAdded(WorktreeId),
|
||||||
|
WorktreeOrderChanged,
|
||||||
|
WorktreeRemoved(WorktreeId),
|
||||||
|
WorktreeUpdatedEntries(WorktreeId, UpdatedEntriesSet),
|
||||||
|
DiskBasedDiagnosticsStarted {
|
||||||
|
language_server_id: LanguageServerId,
|
||||||
|
},
|
||||||
|
DiskBasedDiagnosticsFinished {
|
||||||
|
language_server_id: LanguageServerId,
|
||||||
|
},
|
||||||
|
DiagnosticsUpdated {
|
||||||
|
paths: Vec<ProjectPath>,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
RemoteIdChanged(Option<u64>),
|
||||||
|
DisconnectedFromHost,
|
||||||
|
DisconnectedFromRemote {
|
||||||
|
server_not_running: bool,
|
||||||
|
},
|
||||||
|
Closed,
|
||||||
|
DeletedEntry(WorktreeId, ProjectEntryId),
|
||||||
|
CollaboratorUpdated {
|
||||||
|
old_peer_id: proto::PeerId,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
CollaboratorJoined(proto::PeerId),
|
||||||
|
CollaboratorLeft(proto::PeerId),
|
||||||
|
HostReshared,
|
||||||
|
Reshared,
|
||||||
|
Rejoined,
|
||||||
|
RefreshInlayHints {
|
||||||
|
server_id: LanguageServerId,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
RefreshSemanticTokens {
|
||||||
|
server_id: LanguageServerId,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
RefreshCodeLens,
|
||||||
|
RevealInProjectPanel(ProjectEntryId),
|
||||||
|
SnippetEdit(BufferId, Vec<(lsp::Range, Snippet)>),
|
||||||
|
ExpandedAllForEntry(WorktreeId, ProjectEntryId),
|
||||||
|
EntryRenamed(ProjectTransaction, ProjectPath, PathBuf),
|
||||||
|
WorkspaceEditApplied(ProjectTransaction),
|
||||||
|
AgentLocationChanged,
|
||||||
|
BufferEdited,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
pub struct ProjectPath {
|
||||||
|
pub worktree_id: WorktreeId,
|
||||||
|
pub path: Arc<RelPath>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
<filename>zed/crates/edit_prediction/src/edit_prediction.rs
|
||||||
|
pub struct EditPredictionJumpsFeatureFlag;
|
||||||
|
...
|
||||||
|
pub struct EditPredictionStore {
|
||||||
|
client: Arc<Client>,
|
||||||
|
user_store: Entity<UserStore>,
|
||||||
|
llm_token: LlmApiToken,
|
||||||
|
_llm_token_subscription: Subscription,
|
||||||
|
projects: HashMap<EntityId, ProjectState>,
|
||||||
|
update_required: bool,
|
||||||
|
edit_prediction_model: EditPredictionModel,
|
||||||
|
zeta2_raw_config: Option<Zeta2RawConfig>,
|
||||||
|
pub sweep_ai: SweepAi,
|
||||||
|
pub mercury: Mercury,
|
||||||
|
data_collection_choice: DataCollectionChoice,
|
||||||
|
reject_predictions_tx: mpsc::UnboundedSender<EditPredictionRejection>,
|
||||||
|
shown_predictions: VecDeque<EditPrediction>,
|
||||||
|
rated_predictions: HashSet<EditPredictionId>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
struct ProjectState {
|
||||||
|
events: VecDeque<StoredEvent>,
|
||||||
|
last_event: Option<LastEvent>,
|
||||||
|
recent_paths: VecDeque<ProjectPath>,
|
||||||
|
registered_buffers: HashMap<gpui::EntityId, RegisteredBuffer>,
|
||||||
|
current_prediction: Option<CurrentEditPrediction>,
|
||||||
|
next_pending_prediction_id: usize,
|
||||||
|
pending_predictions: ArrayVec<PendingPrediction, 2>,
|
||||||
|
debug_tx: Option<mpsc::UnboundedSender<DebugEvent>>,
|
||||||
|
last_edit_prediction_refresh: Option<(EntityId, Instant)>,
|
||||||
|
last_jump_prediction_refresh: Option<(EntityId, Instant)>,
|
||||||
|
cancelled_predictions: HashSet<usize>,
|
||||||
|
context: Entity<RelatedExcerptStore>,
|
||||||
|
license_detection_watchers: HashMap<WorktreeId, Rc<LicenseDetectionWatcher>>,
|
||||||
|
user_actions: VecDeque<UserActionRecord>,
|
||||||
|
_subscriptions: [gpui::Subscription; 2],
|
||||||
|
copilot: Option<Entity<Copilot>>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
impl EditPredictionStore {
|
||||||
|
pub fn try_global(cx: &App) -> Option<Entity<Self>> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn global(
|
||||||
|
client: &Arc<Client>,
|
||||||
|
user_store: &Entity<UserStore>,
|
||||||
|
cx: &mut App,
|
||||||
|
) -> Entity<Self> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new(client: Arc<Client>, user_store: Entity<UserStore>, cx: &mut Context<Self>) -> Self {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
fn zeta2_raw_config_from_env() -> Option<Zeta2RawConfig> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_edit_prediction_model(&mut self, model: EditPredictionModel) {
|
||||||
|
self.edit_prediction_model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_zeta2_raw_config(&mut self, config: Zeta2RawConfig) {
|
||||||
|
self.zeta2_raw_config = Some(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn zeta2_raw_config(&self) -> Option<&Zeta2RawConfig> {
|
||||||
|
self.zeta2_raw_config.as_ref()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn icons(&self, cx: &App) -> edit_prediction_types::EditPredictionIconSet {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_sweep_api_token(&self, cx: &App) -> bool {
|
||||||
|
self.sweep_ai.api_token.read(cx).has_key()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_mercury_api_token(&self, cx: &App) -> bool {
|
||||||
|
self.mercury.api_token.read(cx).has_key()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_history(&mut self) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_history_for_project(&mut self, project: &Entity<Project>) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn edit_history_for_project(
|
||||||
|
&self,
|
||||||
|
project: &Entity<Project>,
|
||||||
|
cx: &App,
|
||||||
|
) -> Vec<StoredEvent> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn context_for_project<'a>(
|
||||||
|
&'a self,
|
||||||
|
project: &Entity<Project>,
|
||||||
|
cx: &'a mut App,
|
||||||
|
) -> Vec<RelatedFile> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn copilot_for_project(&self, project: &Entity<Project>) -> Option<Entity<Copilot>> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn start_copilot_for_project(
|
||||||
|
&mut self,
|
||||||
|
project: &Entity<Project>,
|
||||||
|
cx: &mut Context<Self>,
|
||||||
|
) -> Option<Entity<Copilot>> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn context_for_project_with_buffers<'a>(
|
||||||
|
&'a self,
|
||||||
|
project: &Entity<Project>,
|
||||||
|
cx: &'a mut App,
|
||||||
|
) -> Vec<(RelatedFile, Entity<Buffer>)> {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
fn handle_project_event(
|
||||||
|
&mut self,
|
||||||
|
project: Entity<Project>,
|
||||||
|
event: &project::Event,
|
||||||
|
cx: &mut Context<Self>,
|
||||||
|
) {
|
||||||
|
...
|
||||||
|
let Some(project_state) = self.projects.get_mut(&project.entity_id()) else {
|
||||||
|
...
|
||||||
|
if let Some(path) = path {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
fn register_buffer_impl<'a>(
|
||||||
|
project_state: &'a mut ProjectState,
|
||||||
|
buffer: &Entity<Buffer>,
|
||||||
|
project: &Entity<Project>,
|
||||||
|
cx: &mut Context<Self>,
|
||||||
|
) -> &'a mut RegisteredBuffer {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn refresh_prediction_from_diagnostics(
|
||||||
|
&mut self,
|
||||||
|
project: Entity<Project>,
|
||||||
|
scope: DiagnosticSearchScope,
|
||||||
|
cx: &mut Context<Self>,
|
||||||
|
) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
fn predictions_enabled_at(
|
||||||
|
snapshot: &BufferSnapshot,
|
||||||
|
position: Option<language::Anchor>,
|
||||||
|
cx: &App,
|
||||||
|
) -> bool {
|
||||||
|
...
|
||||||
|
<filename>zed/crates/gpui/src/app/context.rs
|
||||||
|
pub struct Context<'a, T> {
|
||||||
|
app: &'a mut App,
|
||||||
|
entity_state: WeakEntity<T>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
<filename>zed/crates/feature_flags/src/feature_flags.rs
|
||||||
|
impl FeatureFlagAppExt for App {
|
||||||
|
...
|
||||||
|
fn has_flag<T: FeatureFlag>(&self) -> bool {
|
||||||
|
self.try_global::<FeatureFlags>()
|
||||||
|
.map(|flags| flags.has_flag::<T>())
|
||||||
|
.unwrap_or_else(|| {
|
||||||
|
(cfg!(debug_assertions) && T::enabled_for_staff() && !*ZED_DISABLE_STAFF)
|
||||||
|
|| T::enabled_for_all()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
<filename>zed/crates/gpui/src/app/entity_map.rs
|
||||||
|
pub struct Entity<T> {
|
||||||
|
#[deref]
|
||||||
|
#[deref_mut]
|
||||||
|
pub(crate) any_entity: AnyEntity,
|
||||||
|
pub(crate) entity_type: PhantomData<fn(T) -> T>,
|
||||||
|
}
|
||||||
|
...
|
||||||
|
|
||||||
|
<filename>edit_history
|
||||||
|
--- a/zed/crates/edit_prediction/src/edit_prediction.rs
|
||||||
|
+++ b/zed/crates/edit_prediction/src/edit_prediction.rs
|
||||||
|
@@ -1035,7 +1035,7 @@
|
||||||
|
project_state.recent_paths.push_front(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- project::Event::DiagnosticsUpdated { .. } => {
|
||||||
|
+ project::Event::Disk { .. } => {
|
||||||
|
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||||
|
self.refresh_prediction_from_diagnostics(
|
||||||
|
project,
|
||||||
|
|
||||||
|
<filename>crates/edit_prediction/src/edit_prediction.rs
|
||||||
|
) {
|
||||||
|
if !is_ep_store_provider(all_language_settings(None, cx).edit_predictions.provider) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// TODO [zeta2] init with recent paths
|
||||||
|
match event {
|
||||||
|
project::Event::ActiveEntryChanged(Some(active_entry_id)) => {
|
||||||
|
let Some(project_state) = self.projects.get_mut(&project.entity_id()) else {
|
||||||
|
<|marker_1|> return;
|
||||||
|
};
|
||||||
|
let path = project.read(cx).path_for_entry(*active_entry_id, cx);
|
||||||
|
if let Some(path) = path {
|
||||||
|
if let Some(ix) = project_state
|
||||||
|
.recent_paths
|
||||||
|
.iter()
|
||||||
|
.position(|probe| probe == &path)
|
||||||
|
{
|
||||||
|
project_state.recent_paths.remove(ix);
|
||||||
|
}
|
||||||
|
project_state.recent_paths.push_front(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
project::Event::Disk<|user_cursor|> { .. } => {
|
||||||
|
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||||
|
<|marker_2|> self.refresh_prediction_from_diagnostics(
|
||||||
|
project,
|
||||||
|
DiagnosticSearchScope::Global,
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn register_buffer_impl<'a>(
|
||||||
|
project_state: &'a mut ProjectState,
|
||||||
|
buffer: &Entity<Buffer>,
|
||||||
|
project: &Entity<Project>,<|marker_3|>
|
||||||
|
<[fim-middle]>
|
||||||
30
special_tokens_map.json
Normal file
30
special_tokens_map.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<[begin▁of▁sentence]>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<[end▁of▁sentence]>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "<[PAD▁TOKEN]>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"sep_token": {
|
||||||
|
"content": "<[SEP▁TOKEN]>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:db6520146c388c495a98bbea62ff6d00c0a8935bed33622e33bb33ec71aaafed
|
||||||
|
size 11891696
|
||||||
1037
tokenizer_config.json
Normal file
1037
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user