初始化项目,由ModelHub XC社区提供模型
Model: Ramikan-BR/Qwen2-0.5B-v19 Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.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
|
||||
unsloth.F16.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
117
README.md
Normal file
117
README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
---
|
||||
base_model: unsloth/qwen2-0.5b-bnb-4bit
|
||||
language:
|
||||
- en
|
||||
license: apache-2.0
|
||||
tags:
|
||||
- text-generation-inference
|
||||
- transformers
|
||||
- unsloth
|
||||
- qwen2
|
||||
- trl
|
||||
- sft
|
||||
---
|
||||
|
||||
1 - # alpaca_prompt = Copied from above
|
||||
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
||||
inputs = tokenizer(
|
||||
[
|
||||
alpaca_prompt.format(
|
||||
# "Continue the fibonnaci sequence.", # instruction
|
||||
# "1, 1, 2, 3, 5, 8", # input
|
||||
"", # output - leave this blank for generation!
|
||||
)
|
||||
], return_tensors = "pt").to("cuda")
|
||||
|
||||
outputs = model.generate(**inputs, max_new_tokens = 128, use_cache = True)
|
||||
tokenizer.batch_decode(outputs)
|
||||
|
||||
['Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Input:\nContinue the fibonnaci sequence.\n\n### Output:\n1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196728, 318101']
|
||||
|
||||
2 - # alpaca_prompt = Copied from above
|
||||
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
||||
inputs = tokenizer(
|
||||
[
|
||||
alpaca_prompt.format(
|
||||
# "What is fibonacci sequence?", # instruction
|
||||
"", # input
|
||||
"", # output - leave this blank for generation!
|
||||
)
|
||||
], return_tensors = "pt").to("cuda")
|
||||
|
||||
from transformers import TextStreamer
|
||||
text_streamer = TextStreamer(tokenizer)
|
||||
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 256)
|
||||
|
||||
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
||||
|
||||
### Input:
|
||||
What is fibonacci sequence?
|
||||
|
||||
### Output:
|
||||
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes like this: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196728, 328101, 544829, 973530, 1518361, 2492891, 4011452, 6504307, 9518768, 15023075
|
||||
|
||||
3 - if False:
|
||||
from unsloth import FastLanguageModel
|
||||
model, tokenizer = FastLanguageModel.from_pretrained(
|
||||
model_name = "lora_model", # YOUR MODEL YOU USED FOR TRAINING
|
||||
max_seq_length = max_seq_length,
|
||||
dtype = dtype,
|
||||
load_in_4bit = load_in_4bit,
|
||||
)
|
||||
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
||||
|
||||
# alpaca_prompt = You MUST copy from above!
|
||||
|
||||
inputs = tokenizer(
|
||||
[
|
||||
alpaca_prompt.format(
|
||||
# "Crie uma IA. Ela será treinada para conversar por chat e escrever códigos em python conforme solicitada, após ser treinada para essas tarefas.", # instruction
|
||||
"", # input
|
||||
"", # output - leave this blank for generation!
|
||||
)
|
||||
], return_tensors = "pt").to("cuda")
|
||||
|
||||
from transformers import TextStreamer
|
||||
text_streamer = TextStreamer(tokenizer)
|
||||
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 4096)
|
||||
|
||||
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
||||
|
||||
### Input:
|
||||
Crie uma IA. Ela será treinada para conversar por chat e escrever codigos em python conforme solicitada, após ser treinada para essas tarefas.
|
||||
|
||||
### Output:
|
||||
Here is a simple Python program that uses the OpenAI's ChatGPT API to simulate a chatbot:
|
||||
|
||||
```python
|
||||
import openai
|
||||
from openai import ChatGPT
|
||||
|
||||
# Initialize the ChatGPT API
|
||||
openai.api_key = "YOUR_API_KEY"
|
||||
|
||||
# Create a ChatGPT model
|
||||
model = ChatGPT(model_name="gpt-3.5-turbo")
|
||||
|
||||
# Create a prompt
|
||||
prompt = "Write a python program that takes a number as input and prints out the square of that number."
|
||||
|
||||
# Send the prompt to the ChatGPT model
|
||||
response = model.create(input=prompt)
|
||||
|
||||
# Print the response
|
||||
print(response)
|
||||
```
|
||||
|
||||
This program will output a Python program that takes a number as input and prints out the square of that number.<|endoftext|>
|
||||
|
||||
# Uploaded model
|
||||
|
||||
- **Developed by:** Ramikan-BR
|
||||
- **License:** apache-2.0
|
||||
- **Finetuned from model :** unsloth/qwen2-0.5b-bnb-4bit
|
||||
|
||||
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
||||
|
||||
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
||||
6
added_tokens.json
Normal file
6
added_tokens.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"<|PAD_TOKEN|>": 151646,
|
||||
"<|endoftext|>": 151643,
|
||||
"<|im_end|>": 151645,
|
||||
"<|im_start|>": 151644
|
||||
}
|
||||
31
config.json
Normal file
31
config.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"_name_or_path": "unsloth/qwen2-0.5b-bnb-4bit",
|
||||
"architectures": [
|
||||
"Qwen2ForCausalLM"
|
||||
],
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 151643,
|
||||
"eos_token_id": 151643,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 896,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 4864,
|
||||
"max_position_embeddings": 131072,
|
||||
"max_window_layers": 24,
|
||||
"model_type": "qwen2",
|
||||
"num_attention_heads": 14,
|
||||
"num_hidden_layers": 24,
|
||||
"num_key_value_heads": 2,
|
||||
"pad_token_id": 151646,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_scaling": null,
|
||||
"rope_theta": 1000000.0,
|
||||
"sliding_window": null,
|
||||
"tie_word_embeddings": true,
|
||||
"torch_dtype": "float16",
|
||||
"transformers_version": "4.43.3",
|
||||
"unsloth_version": "2024.8",
|
||||
"use_cache": true,
|
||||
"use_sliding_window": false,
|
||||
"vocab_size": 151936
|
||||
}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"bos_token_id": 151643,
|
||||
"eos_token_id": 151643,
|
||||
"max_new_tokens": 2048,
|
||||
"transformers_version": "4.43.3"
|
||||
}
|
||||
151388
merges.txt
Normal file
151388
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a8f80b23a325fabc1de5712bad05a287ca8ddf056c1e78ff6a84225cee5edf01
|
||||
size 988097536
|
||||
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:d828a7f78524143d55860bf623f61bad5773a4b2bff56869c86856ba3b5f2530
|
||||
size 988162898
|
||||
14
special_tokens_map.json
Normal file
14
special_tokens_map.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"additional_special_tokens": [
|
||||
"<|im_start|>",
|
||||
"<|im_end|>"
|
||||
],
|
||||
"eos_token": {
|
||||
"content": "<|endoftext|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"pad_token": "<|PAD_TOKEN|>"
|
||||
}
|
||||
303121
tokenizer.json
Normal file
303121
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
52
tokenizer_config.json
Normal file
52
tokenizer_config.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"added_tokens_decoder": {
|
||||
"151643": {
|
||||
"content": "<|endoftext|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"151644": {
|
||||
"content": "<|im_start|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"151645": {
|
||||
"content": "<|im_end|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
},
|
||||
"151646": {
|
||||
"content": "<|PAD_TOKEN|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false,
|
||||
"special": true
|
||||
}
|
||||
},
|
||||
"additional_special_tokens": [
|
||||
"<|im_start|>",
|
||||
"<|im_end|>"
|
||||
],
|
||||
"bos_token": null,
|
||||
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|endoftext|>",
|
||||
"errors": "replace",
|
||||
"model_max_length": 131072,
|
||||
"pad_token": "<|PAD_TOKEN|>",
|
||||
"padding_side": "left",
|
||||
"split_special_tokens": false,
|
||||
"tokenizer_class": "Qwen2Tokenizer",
|
||||
"unk_token": null
|
||||
}
|
||||
3
unsloth.F16.gguf
Normal file
3
unsloth.F16.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d570ba9fa629c346cc392f62367be703cad0c7a658d3c88f97abdb502cc310c4
|
||||
size 994154144
|
||||
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