Upload model
Browse files- README.md +37 -56
- adapter_config.json +4 -4
- adapter_model.safetensors +1 -1
README.md
CHANGED
|
@@ -5,8 +5,8 @@ base_model: mistralai/Mistral-7B-v0.1
|
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
## Model Details
|
|
@@ -17,33 +17,49 @@ Only trained on top-level comments with the most upvotes on each post.
|
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
-
- **Developed by:**
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Uses
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
prompt = f"""
|
| 32 |
-
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 33 |
-
|
| 34 |
-
### Instruction:
|
| 35 |
-
Respond to the reddit post in the style of a University of Waterloo student.
|
| 36 |
|
| 37 |
-
|
| 38 |
-
{post_title}
|
| 39 |
-
{post_text}
|
| 40 |
|
| 41 |
-
|
| 42 |
-
```
|
| 43 |
|
| 44 |
## Bias, Risks, and Limitations
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
|
| 48 |
### Recommendations
|
| 49 |
|
|
@@ -55,42 +71,7 @@ Users (both direct and downstream) should be made aware of the risks, biases and
|
|
| 55 |
|
| 56 |
Use the code below to get started with the model.
|
| 57 |
|
| 58 |
-
|
| 59 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 60 |
-
import torch
|
| 61 |
-
from peft import PeftModel, PeftConfig
|
| 62 |
-
|
| 63 |
-
peft_model_id = "asusevski/mistraloo-sft"
|
| 64 |
-
peft_config = PeftConfig.from_pretrained(peft_model_id)
|
| 65 |
-
model = AutoModelForCausalLM.from_pretrained(peft_config.base_model_name_or_path)
|
| 66 |
-
model = PeftModel.from_pretrained(model, peft_model_id).to(device)
|
| 67 |
-
model.eval()
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 71 |
-
peft_config.base_model_name_or_path,
|
| 72 |
-
add_bos_token=True
|
| 73 |
-
)
|
| 74 |
-
|
| 75 |
-
post_title = "my example post title"
|
| 76 |
-
post_text = "my example post text"
|
| 77 |
-
prompt = f"""
|
| 78 |
-
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 79 |
-
|
| 80 |
-
### Instruction:
|
| 81 |
-
Respond to the reddit post in the style of a University of Waterloo student.
|
| 82 |
-
|
| 83 |
-
### Input:
|
| 84 |
-
{post_title}
|
| 85 |
-
{post_text}
|
| 86 |
-
|
| 87 |
-
### Response:
|
| 88 |
-
"""
|
| 89 |
-
model_input = tokenizer(prompt, return_tensors="pt").to(device)
|
| 90 |
-
with torch.no_grad():
|
| 91 |
-
model_output = model.generate(**model_input, max_new_tokens=256, repetition_penalty=1.15)[0]
|
| 92 |
-
output = tokenizer.decode(model_output, skip_special_tokens=True)
|
| 93 |
-
```
|
| 94 |
|
| 95 |
## Training Details
|
| 96 |
|
|
|
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
+
|
| 10 |
|
| 11 |
|
| 12 |
## Model Details
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
+
- **Developed by:** [More Information Needed]
|
| 21 |
+
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
+
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
+
- **Model type:** [More Information Needed]
|
| 24 |
+
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
+
- **License:** [More Information Needed]
|
| 26 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
+
|
| 28 |
+
### Model Sources [optional]
|
| 29 |
+
|
| 30 |
+
<!-- Provide the basic links for the model. -->
|
| 31 |
+
|
| 32 |
+
- **Repository:** [More Information Needed]
|
| 33 |
+
- **Paper [optional]:** [More Information Needed]
|
| 34 |
+
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
| 38 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
+
|
| 40 |
+
### Direct Use
|
| 41 |
+
|
| 42 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
+
|
| 44 |
+
[More Information Needed]
|
| 45 |
+
|
| 46 |
+
### Downstream Use [optional]
|
| 47 |
+
|
| 48 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
+
|
| 50 |
+
[More Information Needed]
|
| 51 |
|
| 52 |
+
### Out-of-Scope Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
[More Information Needed]
|
|
|
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
|
| 60 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
+
|
| 62 |
+
[More Information Needed]
|
| 63 |
|
| 64 |
### Recommendations
|
| 65 |
|
|
|
|
| 71 |
|
| 72 |
Use the code below to get started with the model.
|
| 73 |
|
| 74 |
+
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
adapter_config.json
CHANGED
|
@@ -19,14 +19,14 @@
|
|
| 19 |
"rank_pattern": {},
|
| 20 |
"revision": null,
|
| 21 |
"target_modules": [
|
| 22 |
-
"
|
| 23 |
"v_proj",
|
| 24 |
"k_proj",
|
|
|
|
| 25 |
"o_proj",
|
| 26 |
"q_proj",
|
| 27 |
-
"
|
| 28 |
-
"up_proj"
|
| 29 |
-
"down_proj"
|
| 30 |
],
|
| 31 |
"task_type": "CAUSAL_LM"
|
| 32 |
}
|
|
|
|
| 19 |
"rank_pattern": {},
|
| 20 |
"revision": null,
|
| 21 |
"target_modules": [
|
| 22 |
+
"down_proj",
|
| 23 |
"v_proj",
|
| 24 |
"k_proj",
|
| 25 |
+
"gate_proj",
|
| 26 |
"o_proj",
|
| 27 |
"q_proj",
|
| 28 |
+
"lm_head",
|
| 29 |
+
"up_proj"
|
|
|
|
| 30 |
],
|
| 31 |
"task_type": "CAUSAL_LM"
|
| 32 |
}
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 600059184
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d382fd5844478693e1257ab3ea5bfb1fddc4b35eccee64f433955b11a21d04e0
|
| 3 |
size 600059184
|