Upload 10 files
Browse filesFiles changed (9)
- README.md+63
- config.jsonAdded+26
- eval_results.jsonAdded+16
- generation_config.jsonAdded+7
- model.safetensorsAdded+3
- special_tokens_map.jsonAdded+30
- tokenizer.jsonAdded
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded+40
123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566---license: apache-2.0datasets:- cerebras/SlimPajama-627B- bigcode/starcoderdata- HuggingFaceH4/ultrachat_200k- HuggingFaceH4/ultrafeedback_binarizedlanguage:- enwidget:- example_title: Fibonacci (Python)messages:- role: systemcontent: You are a chatbot who can help code!- role: usercontent: Write me a function to calculate the first 10 digits of the fibonacci sequence in Python and print it out to the CLI.---<div align="center"># TinyLlama-1.1B</div>https://github.com/jzhang38/TinyLlamaThe TinyLlama project aims to **pretrain** a **1.1B Llama model on 3 trillion tokens**. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.We adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.#### This ModelThis is the chat model finetuned on top of [TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T). **We follow [HF's Zephyr](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha)'s training recipe.** The model was " initially fine-tuned on a variant of the [`UltraChat`](https://huggingface.co/datasets/stingning/ultrachat) dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT.We then further aligned the model with [🤗 TRL's](https://github.com/huggingface/trl) `DPOTrainer` on the [openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset, which contain 64k prompts and model completions that are ranked by GPT-4."#### How to useYou will need the transformers>=4.34Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.```python# Install transformers from source - only needed for versions <= v4.34# pip install git+https://github.com/huggingface/transformers.git# pip install accelerateimport torchfrom transformers import pipelinepipe = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", torch_dtype=torch.bfloat16, device_map="auto")# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templatingmessages = [{"role": "system","content": "You are a friendly chatbot who always responds in the style of a pirate",},{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},]prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)print(outputs[0]["generated_text"])# <|system|># You are a friendly chatbot who always responds in the style of a pirate.</s># <|user|># How many helicopters can a human eat in one sitting?</s># <|assistant|># ...```
1234567891011121314151617181920212223242526{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 5632,
"max_position_embeddings": 2048,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 22,
"num_key_value_heads": 4,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 10000.0,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.35.0",
"use_cache": true,
"vocab_size": 32000
}12345678910111213141516{
"epoch": 3.0,
"eval_logits/chosen": -2.707406759262085,
"eval_logits/rejected": -2.656524419784546,
"eval_logps/chosen": -370.1297607421875,
"eval_logps/rejected": -296.0738525390625,
"eval_loss": 0.513750433921814,
"eval_rewards/accuracies": 0.738095223903656,
"eval_rewards/chosen": -0.02744222804903984,
"eval_rewards/margins": 1.0087225437164307,
"eval_rewards/rejected": -1.03616464138031,
"eval_runtime": 93.5908,
"eval_samples": 2000,
"eval_samples_per_second": 21.37,
"eval_steps_per_second": 0.673
}1234567{
"bos_token_id": 1,
"eos_token_id": 2,
"max_length": 2048,
"pad_token_id": 0,
"transformers_version": "4.35.0"
}123version https://git-lfs.github.com/spec/v1oid sha256:6e6001da2106d4757498752a021df6c2bdc332c650aae4bae6b0c004dcf14933size 2200119864123456789101112131415161718192021222324252627282930{
"bos_token": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}123version https://git-lfs.github.com/spec/v1oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347size 49972312345678910111213141516171819202122232425262728293031323334353637383940{
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<s>",
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
"clean_up_tokenization_spaces": false,
"eos_token": "</s>",
"legacy": false,
"model_max_length": 2048,
"pad_token": "</s>",
"padding_side": "right",
"sp_model_kwargs": {},
"tokenizer_class": "LlamaTokenizer",
"unk_token": "<unk>",
"use_default_system_prompt": false
}README.md+63
config.jsonAdded+26
eval_results.jsonAdded+16
generation_config.jsonAdded+7
model.safetensorsAdded+3
special_tokens_map.jsonAdded+30
tokenizer.jsonAdded
tokenizer.modelAdded+3
tokenizer_config.jsonAdded+40