Push model using huggingface_hub.
Browse files- README.md +42 -0
- adapter_config.json +27 -0
- adapter_model.safetensors +3 -0
- pytorch_model.bin +3 -0
- tokenizer.model +3 -0
README.md
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- trl
|
5 |
+
- transformers
|
6 |
+
- reinforcement-learning
|
7 |
+
---
|
8 |
+
|
9 |
+
# TRL Model
|
10 |
+
|
11 |
+
This is a [TRL language model](https://github.com/lvwerra/trl) that has been fine-tuned with reinforcement learning to
|
12 |
+
guide the model outputs according to a value, function, or human feedback. The model can be used for text generation.
|
13 |
+
|
14 |
+
## Usage
|
15 |
+
|
16 |
+
To use this model for inference, first install the TRL library:
|
17 |
+
|
18 |
+
```bash
|
19 |
+
python -m pip install trl
|
20 |
+
```
|
21 |
+
|
22 |
+
You can then generate text as follows:
|
23 |
+
|
24 |
+
```python
|
25 |
+
from transformers import pipeline
|
26 |
+
|
27 |
+
generator = pipeline("text-generation", model="yuchiz//srv/condor/execute/dir_58527/tmp2m7xrrvu/yuchiz/cache")
|
28 |
+
outputs = generator("Hello, my llama is cute")
|
29 |
+
```
|
30 |
+
|
31 |
+
If you want to use the model for training or to obtain the outputs from the value head, load the model as follows:
|
32 |
+
|
33 |
+
```python
|
34 |
+
from transformers import AutoTokenizer
|
35 |
+
from trl import AutoModelForCausalLMWithValueHead
|
36 |
+
|
37 |
+
tokenizer = AutoTokenizer.from_pretrained("yuchiz//srv/condor/execute/dir_58527/tmp2m7xrrvu/yuchiz/cache")
|
38 |
+
model = AutoModelForCausalLMWithValueHead.from_pretrained("yuchiz//srv/condor/execute/dir_58527/tmp2m7xrrvu/yuchiz/cache")
|
39 |
+
|
40 |
+
inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
|
41 |
+
outputs = model(**inputs, labels=inputs["input_ids"])
|
42 |
+
```
|
adapter_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "berkeley-nest/Starling-LM-7B-alpha",
|
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": 32,
|
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": 16,
|
19 |
+
"rank_pattern": {},
|
20 |
+
"revision": null,
|
21 |
+
"target_modules": [
|
22 |
+
"v_proj",
|
23 |
+
"q_proj"
|
24 |
+
],
|
25 |
+
"task_type": "CAUSAL_LM",
|
26 |
+
"use_rslora": false
|
27 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:059adfa837f7442af84b8617d6c63e075feeb29dea1a76d54ed33553c0a97dcf
|
3 |
+
size 27280152
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a83b0983cd8cf84631a6b08d65e74a19d81f9e55439bf0477ccd155edec0d0b4
|
3 |
+
size 17471
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
|
3 |
+
size 493443
|