初始化项目,由ModelHub XC社区提供模型

Model: boricua/granite-7b-lab-ocp4.15-v0.3
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-17 01:08:28 +08:00
commit 0c8042188c
10 changed files with 93729 additions and 0 deletions

37
.gitattributes vendored Normal file
View File

@@ -0,0 +1,37 @@
*.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
ggml-model-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
ggml-model-f16.gguf filter=lfs diff=lfs merge=lfs -text

64
README.md Normal file
View File

@@ -0,0 +1,64 @@
---
license: apache-2.0
language:
- en
---
## Model Card
This is a fine-tuned [granite-7b-lab](https://huggingface.co/instructlab/granite-7b-lab) on OpenShift 4.15 documentation using 45212 Q&A pairs.
- **Fine tuned by:** [William Caban](https://www.linkedin.com/in/williamcaban)
- **License:** Apache 2.0
- **Context length:** 32K (base model)
- **OpenShift 4.15 Knowledge cutoff date:** April 12 2024
### Method
The Q&A corpus was generated using the following methodology:
1. Generated 5 Q&A pairs for each page on OpenShift (OCP) 4.15 PDFs with lengths greater than 1500 characters. The length was chosen to remove the title page and pages without much content.
2. The [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) was used to generate the questions for each page.
3. The [Mixtral-8x22B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1) was used to generate the answer from the content in the page.
4. A voting evaluation between Mixtral-8x22B and Llama3-7B was used to evaluate the quality of Q&A pair in relation to the page content and removed low quality entries.
5. Removed Q&A pairs with questions containing phrases or words like "this example", "this context", "this document", "trademark" and "copyright"
The resulting corpus is a 45212 Q&A-pairs. The corups was divided into training (42951 Q&A pairs) and eval (2261 Q&A pairs).
The model was trained on 3000 iterations.
**KNOWN LIMITATIONS** There is significant drop in accuracy and performance when using a quantized version of this model.
### Using the model
When using in combination with RAG, the model has preference for a `CONTEXT` section from which to augment its knowledge.
```bash
## INSTRUCTIONS
<your_instructions_here>
## TASK
<what_you_want_the_model_to_achieve>
## CONTEXT
<any_new_or_additional_context_for_answering_question>
## QUESTION
<question_from_user>
```
## Intended Use
- This model is a quick proof of concept (POC) for the fine tuning a base model with expertise and basic guardrails to reduce the reliance on prompts and multiple filtering mechanism to moderate the results.
- The model improves the quality of responses about OpenShift topics without RAG content while further improving responses when RAG context is provided.
- The model was created as a POC in a lab environment and as such it is not intended for production use.
## Bias, Risks, and Limitations
- The model was trained with basic instructions to refuse answering questions unrelated to Kubernetes, OpenShift and Kubernetes related topics.
Due to strict instructions during training, the model may refuse to answer valid Kubernetes or OpenShift questions when topics of the context were not present during training.
- The model has not been aligned to human social preferences, so the model might produce problematic output.
The model might also maintain the limitations and constraints that arise from the base model.
- The model undergoes training on synthetic data, leading to the potential inheritance of both advantages and limitations from the underlying data generation methods.
- In the absence of adequate safeguards and RLHF, there exists a risk of malicious utilization of these models for generating disinformation or harmful content. Caution is urged against complete reliance on a specific language model for crucial decisions or impactful information, as preventing these models from fabricating content is not straightforward. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in ungrounded generation scenarios due to their reduced sizes and memorization capacities. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain.

7
added_tokens.json Normal file
View File

@@ -0,0 +1,7 @@
{
"<|assistant|>": 32003,
"<|endoftext|>": 32000,
"<|pad|>": 32001,
"<|system|>": 32004,
"<|user|>": 32002
}

82
config.json Normal file
View File

@@ -0,0 +1,82 @@
{
"vocab_size": 32008,
"max_position_embeddings": 2048,
"hidden_size": 4096,
"intermediate_size": 11008,
"num_hidden_layers": 32,
"num_attention_heads": 32,
"num_key_value_heads": 32,
"hidden_act": "silu",
"initializer_range": 0.02,
"rms_norm_eps": 1e-05,
"pretraining_tp": 1,
"use_cache": true,
"rope_theta": 10000.0,
"rope_scaling": null,
"attention_bias": false,
"attention_dropout": 0.0,
"return_dict": true,
"output_hidden_states": false,
"output_attentions": false,
"torchscript": false,
"torch_dtype": null,
"use_bfloat16": false,
"tf_legacy_loss": false,
"pruned_heads": {},
"tie_word_embeddings": false,
"chunk_size_feed_forward": 0,
"is_encoder_decoder": false,
"is_decoder": false,
"cross_attention_hidden_size": null,
"add_cross_attention": false,
"tie_encoder_decoder": false,
"max_length": 20,
"min_length": 0,
"do_sample": false,
"early_stopping": false,
"num_beams": 1,
"num_beam_groups": 1,
"diversity_penalty": 0.0,
"temperature": 1.0,
"top_k": 50,
"top_p": 1.0,
"typical_p": 1.0,
"repetition_penalty": 1.0,
"length_penalty": 1.0,
"no_repeat_ngram_size": 0,
"encoder_no_repeat_ngram_size": 0,
"bad_words_ids": null,
"num_return_sequences": 1,
"output_scores": false,
"return_dict_in_generate": false,
"forced_bos_token_id": null,
"forced_eos_token_id": null,
"remove_invalid_values": false,
"exponential_decay_length_penalty": null,
"suppress_tokens": null,
"begin_suppress_tokens": null,
"architectures": [
"LlamaForCausalLM"
],
"finetuning_task": null,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1"
},
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1
},
"tokenizer_class": null,
"prefix": null,
"bos_token_id": 1,
"pad_token_id": null,
"eos_token_id": 2,
"sep_token_id": null,
"decoder_start_token_id": null,
"task_specific_params": null,
"problem_type": null,
"_name_or_path": "instructlab-granite-7b-lab-mlx-q-fused",
"transformers_version": "4.40.2",
"model_type": "llama"
}

3
ggml-model-f16.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1eddc043bdb8c615c4b1656d3cb04f86da95b98a420ad9dfe424e5cff01d4ad5
size 13478236576

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83f7f1fa7276fd7c8cacbfded102c30984d146a18e1b2f61e9c87862fa49e7dd
size 13476996016

35
special_tokens_map.json Normal file
View File

@@ -0,0 +1,35 @@
{
"additional_special_tokens": [
"<|system|>",
"<|user|>",
"<|assistant|>"
],
"bos_token": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

93409
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

BIN
tokenizer.model (Stored with Git LFS) Normal file

Binary file not shown.

86
tokenizer_config.json Normal file
View File

@@ -0,0 +1,86 @@
{
"add_bos_token": false,
"add_eos_token": false,
"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
},
"32000": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"32001": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"32002": {
"content": "<|user|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"32003": {
"content": "<|assistant|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"32004": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|system|>",
"<|user|>",
"<|assistant|>"
],
"bos_token": "<s>",
"chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|>'+ '\n' + message['content'] + '\n'}}{% elif message['role'] == 'user' %}{{'<|user|>' + '\n' + message['content'] + '\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>' + '\n' + message['content'] + '<|endoftext|>' + ('' if loop.last else '\n')}}{% endif %}{% endfor %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"fast_tokenizer": true,
"model_max_length": 1000000000000000019884624838656,
"pad_token": "<|pad|>",
"sp_model_kwargs": {},
"tokenizer_class": "LlamaTokenizer",
"unk_token": "<unk>",
"use_default_system_prompt": false
}