LoneStriker
commited on
Commit
•
3e9d6c2
1
Parent(s):
464ad02
Upload folder using huggingface_hub
Browse files- README.md +112 -0
- config.json +29 -0
- generation_config.json +7 -0
- output.safetensors +3 -0
- special_tokens_map.json +24 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +42 -0
README.md
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- WizardLM/WizardLM_evol_instruct_V2_196k
|
5 |
+
- icybee/share_gpt_90k_v1
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
widget:
|
9 |
+
- example_title: "example 1"
|
10 |
+
text: "How do I mount a tv to drywall safely?"
|
11 |
+
output:
|
12 |
+
text: "Mounting a TV to drywall safely is crucial to ensure the longevity of your TV and the wall. Here's a step-by-step guide on how to do it safely:\n 1. Choose the right mount: Choose a mount that is compatible with your TV and the wall. Make sure the mount is rated for drywall and not just wood or concrete.\n 2. Prepare the wall: Before mounting the TV, make sure the wall is clean and free from any debris or paint. Use a stud finder to locate the studs in the wall.\n 3. Install the mount: Follow the manufacturer's instructions for mounting the TV to the wall. Use appropriate hardware and tools to secure the mount to the wall.\n 4. Level the TV: Level the TV on the mount using a spirit level or a leveling kit provided by the mount manufacturer.\n 5. Attach the TV to the mount: Attach the TV to the mount using the appropriate hardware and tools. Tighten the bolts and screws to ensure the TV is securely attached.\n 6. Connect the cables: Connect the TV cables to the appropriate ports on the back of the TV and the mount.\n 7. Test the mount: Test the mount to ensure it's secure and stable. Adjust the mount as needed to ensure the TV is level and secure.\n Mounting a TV to drywall safely is crucial to avoid damaging the wall or the TV. Follow these steps carefully and use appropriate tools and hardware to ensure a secure and stable installation."
|
13 |
+
- example_title: "example 2"
|
14 |
+
text: "Happy is to sad as calm is to _."
|
15 |
+
output:
|
16 |
+
text: "The adjective that can be used to describe the opposite of calm is \"anxious\" or \"stressed.\" So, from happy to sad, we can say that happy is to sad as calm is to anxious or stressed."
|
17 |
+
library_name: transformers
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
tags:
|
20 |
+
- nlp
|
21 |
+
- llm
|
22 |
+
---
|
23 |
+
# AmberChat
|
24 |
+
|
25 |
+
|
26 |
+
We present AmberChat, an instruction following model finetuned from [LLM360/Amber](https://huggingface.co/LLM360/Amber).
|
27 |
+
|
28 |
+
## Model Description
|
29 |
+
|
30 |
+
- **Model type:** Language model with the same architecture as LLaMA-7B
|
31 |
+
- **Language(s) (NLP):** English
|
32 |
+
- **License:** Apache 2.0
|
33 |
+
- **Resources for more information:**
|
34 |
+
- [Metrics](https://github.com/LLM360/Analysis360)
|
35 |
+
- [Fully processed Amber pretraining data](https://huggingface.co/datasets/LLM360/AmberDatasets)
|
36 |
+
|
37 |
+
|
38 |
+
# Loading AmberChat
|
39 |
+
|
40 |
+
```python
|
41 |
+
import torch
|
42 |
+
from transformers import LlamaTokenizer, LlamaForCausalLM
|
43 |
+
|
44 |
+
tokenizer = LlamaTokenizer.from_pretrained("LLM360/AmberChat")
|
45 |
+
model = LlamaForCausalLM.from_pretrained("LLM360/AmberChat")
|
46 |
+
|
47 |
+
#template adapated from fastchat
|
48 |
+
template= "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n### Human: Got any creative ideas for a 10 year old’s birthday?\n### Assistant: Of course! Here are some creative ideas for a 10-year-old's birthday party:\n1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n3. Outdoor Movie Night: Set up a backyard movie night with a projector and a large screen or white sheet. Create a cozy seating area with blankets and pillows, and serve popcorn and snacks while the kids enjoy a favorite movie under the stars.\n4. DIY Crafts Party: Arrange a craft party where kids can unleash their creativity. Provide a variety of craft supplies like beads, paints, and fabrics, and let them create their own unique masterpieces to take home as party favors.\n5. Sports Olympics: Host a mini Olympics event with various sports and games. Set up different stations for activities like sack races, relay races, basketball shooting, and obstacle courses. Give out medals or certificates to the participants.\n6. Cooking Party: Have a cooking-themed party where the kids can prepare their own mini pizzas, cupcakes, or cookies. Provide toppings, frosting, and decorating supplies, and let them get hands-on in the kitchen.\n7. Superhero Training Camp: Create a superhero-themed party where the kids can engage in fun training activities. Set up an obstacle course, have them design their own superhero capes or masks, and organize superhero-themed games and challenges.\n8. Outdoor Adventure: Plan an outdoor adventure party at a local park or nature reserve. Arrange activities like hiking, nature scavenger hunts, or a picnic with games. Encourage exploration and appreciation for the outdoors.\nRemember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!\n### Human: {prompt}\n### Assistant:"
|
49 |
+
|
50 |
+
prompt = "How do I mount a tv to drywall safely?"
|
51 |
+
|
52 |
+
input_str = template.format(prompt=prompt)
|
53 |
+
input_ids = tokenizer(input_str, return_tensors="pt").input_ids
|
54 |
+
outputs = model.generate(input_ids, max_length=1000)
|
55 |
+
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
|
56 |
+
```
|
57 |
+
|
58 |
+
Alternatively, you may use [FastChat](https://github.com/lm-sys/FastChat):
|
59 |
+
```bash
|
60 |
+
python3 -m fastchat.serve.cli --model-path LLM360/AmberChat
|
61 |
+
```
|
62 |
+
|
63 |
+
# AmberChat Finetuning Details
|
64 |
+
|
65 |
+
## DataMix
|
66 |
+
| Subset | Number of rows | License |
|
67 |
+
| ----------- | ----------- | ----------- |
|
68 |
+
| WizardLM/WizardLM_evol_instruct_V2_196k | 143k | |
|
69 |
+
| icybee/share_gpt_90k_v1 | 90k | cc0-1.0 |
|
70 |
+
| Total | 233k | |
|
71 |
+
|
72 |
+
## Hyperparameters
|
73 |
+
| Hyperparameter | Value |
|
74 |
+
| ----------- | ----------- |
|
75 |
+
| Total Parameters | 6.7B |
|
76 |
+
| Hidden Size | 4096 |
|
77 |
+
| Intermediate Size (MLPs) | 11008 |
|
78 |
+
| Number of Attention Heads | 32 |
|
79 |
+
| Number of Hidden Lyaers | 32 |
|
80 |
+
| RMSNorm ɛ | 1e^-6 |
|
81 |
+
| Max Seq Length | 2048 |
|
82 |
+
| Vocab Size | 32000 |
|
83 |
+
|
84 |
+
| Training Hyperparameter | Value |
|
85 |
+
| ----------- | ----------- |
|
86 |
+
| learning_rate | 2e-5 |
|
87 |
+
| num_train_epochs | 3 |
|
88 |
+
| per_device_train_batch_size | 2 |
|
89 |
+
| gradient_accumulation_steps | 16 |
|
90 |
+
| warmup_ratio | 0.04 |
|
91 |
+
| model_max_length | 2048 |
|
92 |
+
|
93 |
+
|
94 |
+
# Evaluation
|
95 |
+
|
96 |
+
| Model | MT-Bench |
|
97 |
+
|------------------------------------------------------|------------------------------------------------------------|
|
98 |
+
| LLM360/Amber 359 | 2.48750 |
|
99 |
+
| **LLM360/AmberChat** | **5.428125** |
|
100 |
+
|
101 |
+
# Citation
|
102 |
+
|
103 |
+
**BibTeX:**
|
104 |
+
|
105 |
+
```bibtex
|
106 |
+
@article{xxx,
|
107 |
+
title={XXX},
|
108 |
+
author={XXX},
|
109 |
+
journal={XXX},
|
110 |
+
year={2023}
|
111 |
+
}
|
112 |
+
```
|
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "ckpt_359",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"hidden_act": "silu",
|
10 |
+
"hidden_size": 4096,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 11008,
|
13 |
+
"max_position_embeddings": 2048,
|
14 |
+
"max_sequence_length": 2048,
|
15 |
+
"model_type": "llama",
|
16 |
+
"num_attention_heads": 32,
|
17 |
+
"num_hidden_layers": 32,
|
18 |
+
"num_key_value_heads": 32,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"pretraining_tp": 1,
|
21 |
+
"rms_norm_eps": 1e-06,
|
22 |
+
"rope_scaling": null,
|
23 |
+
"rope_theta": 10000.0,
|
24 |
+
"tie_word_embeddings": false,
|
25 |
+
"torch_dtype": "float32",
|
26 |
+
"transformers_version": "4.34.1",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 32000
|
29 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.34.1"
|
7 |
+
}
|
output.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7c9f0f6a438457fb8e07591459c9230f57956d53f2e77aafe911bfc75688bbe6
|
3 |
+
size 6839476380
|
special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<unk>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<unk>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"0": {
|
6 |
+
"content": "<unk>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
},
|
21 |
+
"2": {
|
22 |
+
"content": "</s>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": true,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false,
|
27 |
+
"special": true
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"bos_token": "<s>",
|
31 |
+
"clean_up_tokenization_spaces": false,
|
32 |
+
"eos_token": "</s>",
|
33 |
+
"legacy": true,
|
34 |
+
"model_max_length": 2048,
|
35 |
+
"pad_token": "<unk>",
|
36 |
+
"padding_side": "right",
|
37 |
+
"sp_model_kwargs": {},
|
38 |
+
"spaces_between_special_tokens": false,
|
39 |
+
"tokenizer_class": "LlamaTokenizer",
|
40 |
+
"unk_token": "<unk>",
|
41 |
+
"use_default_system_prompt": false
|
42 |
+
}
|