tgaddair commited on
Commit
09f76bc
1 Parent(s): 034514d

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +99 -1
  2. adapter_config.json +26 -0
  3. adapter_model.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,101 @@
1
  ---
2
- license: apache-2.0
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: peft
3
+ base_model: mistralai/Mistral-7B-v0.1
4
+ datasets:
5
+ - amazon_us_reviews
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 the text of a review, predict the score from the user from 1 to 5.
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
+ review = "<your product review>"
22
+
23
+ prompt = f"""
24
+ Below is the text from a review from an Amazon user for a product they
25
+ purchased. Please predict how many stars they gave the product in their
26
+ review.
27
+
28
+ Review: {review}
29
+
30
+ Number of stars:
31
+ """
32
+
33
+ adapter_id = "tgaddair/mistral-7b-amazon-reviews-lora-r8"
34
+ resp = client.generate(prompt, max_new_tokens=64, adapter_id=adapter_id)
35
+ print(resp.generated_text)
36
+ ```
37
+
38
+
39
+
40
+ ## Model Details
41
+
42
+ ### Model Description
43
+
44
+ Ludwig config (v0.9.3):
45
+
46
+ ```yaml
47
+ model_type: llm
48
+ input_features:
49
+ - name: prompt
50
+ type: text
51
+ preprocessing:
52
+ max_sequence_length: null
53
+ column: prompt
54
+ output_features:
55
+ - name: stars
56
+ type: text
57
+ preprocessing:
58
+ max_sequence_length: null
59
+ column: stars
60
+ prompt:
61
+ template: >-
62
+ Below is the text from a review from an Amazon user for a product they
63
+ purchased. Please predict how many stars they gave the product in their
64
+ review.
65
+
66
+
67
+ Review: {text}
68
+
69
+
70
+ Number of stars:
71
+ preprocessing:
72
+ split:
73
+ type: random
74
+ probabilities:
75
+ - 0.95
76
+ - 0
77
+ - 0.05
78
+ global_max_sequence_length: 2048
79
+ adapter:
80
+ type: lora
81
+ generation:
82
+ max_new_tokens: 64
83
+ trainer:
84
+ type: finetune
85
+ epochs: 3
86
+ optimizer:
87
+ type: paged_adam
88
+ batch_size: 1
89
+ eval_steps: 100
90
+ learning_rate: 0.0002
91
+ eval_batch_size: 2
92
+ steps_per_checkpoint: 1000
93
+ learning_rate_scheduler:
94
+ decay: cosine
95
+ warmup_fraction: 0.03
96
+ gradient_accumulation_steps: 16
97
+ enable_gradient_checkpointing: true
98
+ base_model: mistralai/Mistral-7B-v0.1
99
+ quantization:
100
+ bits: 4
101
+ ```
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:1be993e454ad6ccdd03e8797c9f95082efe7a60ce5af76563fa9ed6bd4e144c0
3
+ size 13648432