Upload 3 files
Browse files- README.md +102 -1
- adapter_config.json +26 -0
- adapter_model.safetensors +3 -0
README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
base_model: mistralai/Mistral-7B-v0.1
|
| 4 |
+
datasets:
|
| 5 |
+
- ise-uiuc/Magicoder-OSS-Instruct-75K
|
| 6 |
---
|
| 7 |
+
|
| 8 |
+
# Model Card for Model ID
|
| 9 |
+
|
| 10 |
+
Trained with [Ludwig.ai](https://ludwig.ai) and [Predibase](https://predibase.com)!
|
| 11 |
+
|
| 12 |
+
Given a programming problem and a target language, generate a solution.
|
| 13 |
+
|
| 14 |
+
Try it in [LoRAX](https://github.com/predibase/lorax):
|
| 15 |
+
|
| 16 |
+
```python
|
| 17 |
+
from lorax import Client
|
| 18 |
+
|
| 19 |
+
client = Client("http://<your_endpoint>")
|
| 20 |
+
|
| 21 |
+
problem = "<your programming problem>"
|
| 22 |
+
lang = "<your programming language>"
|
| 23 |
+
|
| 24 |
+
prompt = f"""
|
| 25 |
+
Below is a programming problem, paired with a language in which the solution
|
| 26 |
+
should be written. Write a solution in the provided that appropriately
|
| 27 |
+
solves the programming problem.
|
| 28 |
+
|
| 29 |
+
### Problem: {problem}
|
| 30 |
+
|
| 31 |
+
### Language: {lang}
|
| 32 |
+
|
| 33 |
+
### Solution:
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
adapter_id = "tgaddair/mistral-7b-magicoder-lora-r8"
|
| 37 |
+
resp = client.generate(prompt, max_new_tokens=64, adapter_id=adapter_id)
|
| 38 |
+
print(resp.generated_text)
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## Model Details
|
| 44 |
+
|
| 45 |
+
### Model Description
|
| 46 |
+
|
| 47 |
+
Ludwig config (v0.9.3):
|
| 48 |
+
|
| 49 |
+
```yaml
|
| 50 |
+
model_type: llm
|
| 51 |
+
input_features:
|
| 52 |
+
- name: prompt
|
| 53 |
+
type: text
|
| 54 |
+
preprocessing:
|
| 55 |
+
max_sequence_length: null
|
| 56 |
+
column: prompt
|
| 57 |
+
output_features:
|
| 58 |
+
- name: solution
|
| 59 |
+
type: text
|
| 60 |
+
preprocessing:
|
| 61 |
+
max_sequence_length: null
|
| 62 |
+
column: solution
|
| 63 |
+
prompt:
|
| 64 |
+
template: >-
|
| 65 |
+
Below is a programming problem, paired with a language in which the solution
|
| 66 |
+
should be written. Write a solution in the provided that appropriately
|
| 67 |
+
solves the programming problem.
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
### Problem: {problem}
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
### Language: {lang}
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
### Solution:
|
| 77 |
+
preprocessing:
|
| 78 |
+
split:
|
| 79 |
+
type: fixed
|
| 80 |
+
column: split
|
| 81 |
+
global_max_sequence_length: 2048
|
| 82 |
+
adapter:
|
| 83 |
+
type: lora
|
| 84 |
+
generation:
|
| 85 |
+
max_new_tokens: 64
|
| 86 |
+
trainer:
|
| 87 |
+
type: finetune
|
| 88 |
+
epochs: 1
|
| 89 |
+
optimizer:
|
| 90 |
+
type: paged_adam
|
| 91 |
+
batch_size: 1
|
| 92 |
+
eval_steps: 100
|
| 93 |
+
learning_rate: 0.0002
|
| 94 |
+
eval_batch_size: 2
|
| 95 |
+
steps_per_checkpoint: 1000
|
| 96 |
+
learning_rate_scheduler:
|
| 97 |
+
decay: cosine
|
| 98 |
+
warmup_fraction: 0.03
|
| 99 |
+
gradient_accumulation_steps: 16
|
| 100 |
+
enable_gradient_checkpointing: true
|
| 101 |
+
base_model: mistralai/Mistral-7B-v0.1
|
| 102 |
+
quantization:
|
| 103 |
+
bits: 4
|
| 104 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "mistralai/Mistral-7B-v0.1",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"fan_in_fan_out": false,
|
| 7 |
+
"inference_mode": true,
|
| 8 |
+
"init_lora_weights": true,
|
| 9 |
+
"layers_pattern": null,
|
| 10 |
+
"layers_to_transform": null,
|
| 11 |
+
"loftq_config": {},
|
| 12 |
+
"lora_alpha": 16,
|
| 13 |
+
"lora_dropout": 0.05,
|
| 14 |
+
"megatron_config": null,
|
| 15 |
+
"megatron_core": "megatron.core",
|
| 16 |
+
"modules_to_save": null,
|
| 17 |
+
"peft_type": "LORA",
|
| 18 |
+
"r": 8,
|
| 19 |
+
"rank_pattern": {},
|
| 20 |
+
"revision": null,
|
| 21 |
+
"target_modules": [
|
| 22 |
+
"v_proj",
|
| 23 |
+
"q_proj"
|
| 24 |
+
],
|
| 25 |
+
"task_type": "CAUSAL_LM"
|
| 26 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe11768d3f772a05274cbeee8dcc0ce8fe80f20d9cecd46373077365ef12d852
|
| 3 |
+
size 13648432
|