初始化项目,由ModelHub XC社区提供模型
Model: LoupGarou/WizardCoder-Guanaco-15B-V1.0 Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
80
README.md
Normal file
80
README.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
language:
|
||||
- en
|
||||
datasets:
|
||||
- guanaco
|
||||
model_hub_library:
|
||||
- transformers
|
||||
license:
|
||||
- apache-2.0
|
||||
---
|
||||
|
||||
## WizardGuanaco-V1.0 Model Card
|
||||
The WizardCoder-Guanaco-15B-V1.0 is a language model that combines the strengths of the [WizardCoder](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0) base model and the [openassistant-guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco) dataset for finetuning. The openassistant-guanaco dataset was further trimmed to within 2 standard deviations of token size for input and output pairs and all non-english data has been removed to reduce training size requirements.
|
||||
|
||||
# Model Description
|
||||
This model is built on top of the WizardCoder base model, a large language model known for its impressive capabilities in code related instruction. The WizardCoder base model was further finetuned using QLORA on the openassistant-guanaco dataset to enhance its generative abilities.
|
||||
|
||||
However, to ensure more targeted learning and data processing, the dataset was trimmed to within 2 standard deviations of token size for question sets. This process enhances the model's ability to generate more precise and relevant answers, eliminating outliers that could potentially distort the responses. In addition, to focus on English language proficiency, all non-English data has been removed from the Guanaco dataset.
|
||||
|
||||
# Intended Use
|
||||
This model is designed to be used for a wide array of text generation tasks that require understanding and generating English text. The model is expected to perform well in tasks such as answering questions, writing essays, summarizing text, translation, and more. However, given the specific data processing and finetuning done, it might be particularly effective for tasks related to English language question-answering systems.
|
||||
|
||||
# Limitations
|
||||
Despite the powerful capabilities of this model, users should be aware of its limitations. The model's knowledge is up to date only until the time it was trained, and it doesn't know about events in the world after that. It can sometimes produce incorrect or nonsensical responses, as it doesn't understand the text in the same way humans do. It should be used as a tool to assist in generating text and not as a sole source of truth.
|
||||
|
||||
# How to use
|
||||
Here is an example of how to use this model:
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
import time
|
||||
import torch
|
||||
|
||||
class Chatbot:
|
||||
def __init__(self, model_name):
|
||||
self.tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side='left')
|
||||
self.model = AutoModelForCausalLM.from_pretrained(model_name, load_in_4bit=True, torch_dtype=torch.bfloat16)
|
||||
if self.tokenizer.pad_token_id is None:
|
||||
self.tokenizer.pad_token_id = self.tokenizer.eos_token_id
|
||||
|
||||
def get_response(self, prompt):
|
||||
inputs = self.tokenizer.encode_plus(prompt, return_tensors="pt", padding='max_length', max_length=100)
|
||||
if next(self.model.parameters()).is_cuda:
|
||||
inputs = {name: tensor.to('cuda') for name, tensor in inputs.items()}
|
||||
start_time = time.time()
|
||||
tokens = self.model.generate(input_ids=inputs['input_ids'],
|
||||
attention_mask=inputs['attention_mask'],
|
||||
pad_token_id=self.tokenizer.pad_token_id,
|
||||
max_new_tokens=400)
|
||||
end_time = time.time()
|
||||
output_tokens = tokens[0][inputs['input_ids'].shape[-1]:]
|
||||
output = self.tokenizer.decode(output_tokens, skip_special_tokens=True)
|
||||
time_taken = end_time - start_time
|
||||
return output, time_taken
|
||||
|
||||
def main():
|
||||
chatbot = Chatbot("LoupGarou/WizardCoder-Guanaco-15B-V1.0")
|
||||
while True:
|
||||
user_input = input("Enter your prompt: ")
|
||||
if user_input.lower() == 'quit':
|
||||
break
|
||||
output, time_taken = chatbot.get_response(user_input)
|
||||
print("\033[33m" + output + "\033[0m")
|
||||
print("Time taken to process: ", time_taken, "seconds")
|
||||
print("Exited the program.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
```
|
||||
|
||||
# Training Procedure
|
||||
The base WizardCoder model was finetuned on the openassistant-guanaco dataset using QLORA, which was trimmed to within 2 standard deviations of token size for question sets and randomized. All non-English data was also removed from this finetuning dataset.
|
||||
|
||||
## Acknowledgements
|
||||
This model, WizardCoder-Guanaco-15B-V1.0, is simply building on the efforts of two great teams to evaluate the performance of a combined model with the strengths of the [WizardCoder base model](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0) and the [openassistant-guanaco dataset](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
|
||||
|
||||
A sincere appreciation goes out to the developers and the community involved in the creation and refinement of these models. Their commitment to providing open source tools and datasets have been instrumental in making this project a reality.
|
||||
|
||||
Moreover, a special note of thanks to the [Hugging Face](https://huggingface.co/) team, whose transformative library has not only streamlined the process of model creation and adaptation, but also democratized the access to state-of-the-art machine learning technologies. Their impact on the development of this project cannot be overstated.
|
||||
3
added_tokens.json
Normal file
3
added_tokens.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"[PAD]": 49152
|
||||
}
|
||||
39
config.json
Normal file
39
config.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"_name_or_path": "bigcode/starcoder",
|
||||
"activation_function": "gelu",
|
||||
"architectures": [
|
||||
"GPTBigCodeForCausalLM"
|
||||
],
|
||||
"attention_softmax_in_fp32": true,
|
||||
"attn_pdrop": 0.1,
|
||||
"bos_token_id": 0,
|
||||
"embd_pdrop": 0.1,
|
||||
"eos_token_id": 0,
|
||||
"inference_runner": 0,
|
||||
"initializer_range": 0.02,
|
||||
"layer_norm_epsilon": 1e-05,
|
||||
"max_batch_size": null,
|
||||
"max_sequence_length": null,
|
||||
"model_type": "gpt_bigcode",
|
||||
"multi_query": true,
|
||||
"n_embd": 6144,
|
||||
"n_head": 48,
|
||||
"n_inner": 24576,
|
||||
"n_layer": 40,
|
||||
"n_positions": 8192,
|
||||
"pad_key_length": true,
|
||||
"pre_allocate_kv_cache": false,
|
||||
"resid_pdrop": 0.1,
|
||||
"scale_attention_softmax_in_fp32": true,
|
||||
"scale_attn_weights": true,
|
||||
"summary_activation": null,
|
||||
"summary_first_dropout": 0.1,
|
||||
"summary_proj_to_labels": true,
|
||||
"summary_type": "cls_index",
|
||||
"summary_use_proj": true,
|
||||
"torch_dtype": "float16",
|
||||
"transformers_version": "4.30.0.dev0",
|
||||
"use_cache": true,
|
||||
"validate_runner_input": true,
|
||||
"vocab_size": 49153
|
||||
}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 0,
|
||||
"eos_token_id": 0,
|
||||
"transformers_version": "4.30.0.dev0"
|
||||
}
|
||||
48892
merges.txt
Normal file
48892
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1374d764fe47683ff4f0c68d71444da95bd93a86e99b6a4e947b8728e5710ddf
|
||||
size 31035114161
|
||||
27
special_tokens_map.json
Normal file
27
special_tokens_map.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"additional_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<fim_prefix>",
|
||||
"<fim_middle>",
|
||||
"<fim_suffix>",
|
||||
"<fim_pad>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<empty_output>",
|
||||
"<commit_before>",
|
||||
"<commit_msg>",
|
||||
"<commit_after>",
|
||||
"<reponame>"
|
||||
],
|
||||
"bos_token": "<|endoftext|>",
|
||||
"eos_token": "<|endoftext|>",
|
||||
"pad_token": "[PAD]",
|
||||
"unk_token": "<|endoftext|>"
|
||||
}
|
||||
98266
tokenizer.json
Normal file
98266
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
32
tokenizer_config.json
Normal file
32
tokenizer_config.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"additional_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<fim_prefix>",
|
||||
"<fim_middle>",
|
||||
"<fim_suffix>",
|
||||
"<fim_pad>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<empty_output>",
|
||||
"<commit_before>",
|
||||
"<commit_msg>",
|
||||
"<commit_after>",
|
||||
"<reponame>"
|
||||
],
|
||||
"bos_token": "<|endoftext|>",
|
||||
"clean_up_tokenization_spaces": true,
|
||||
"eos_token": "<|endoftext|>",
|
||||
"model_max_length": 2048,
|
||||
"padding_side": "right",
|
||||
"tokenizer_class": "GPT2Tokenizer",
|
||||
"unk_token": "<|endoftext|>",
|
||||
"vocab_size": 49152
|
||||
}
|
||||
1
vocab.json
Normal file
1
vocab.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user