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

Model: prithivMLmods/Llama3.1-8B-Grpo-Reasoning
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-09-07 09:06:13 +08:00
commit b7ecce6f01
13 changed files with 2296 additions and 0 deletions

52
.gitattributes vendored Normal file
View File

@@ -0,0 +1,52 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bin.* filter=lfs diff=lfs merge=lfs -text
*.bz2 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
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack 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
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
saved_model/**/* 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
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zstandard filter=lfs diff=lfs merge=lfs -text
*.tfevents* filter=lfs diff=lfs merge=lfs -text
*.db* filter=lfs diff=lfs merge=lfs -text
*.ark* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.gguf* filter=lfs diff=lfs merge=lfs -text
*.ggml filter=lfs diff=lfs merge=lfs -text
*.llamafile* filter=lfs diff=lfs merge=lfs -text
*.pt2 filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
pytorch_model-00001-of-00004.bin filter=lfs diff=lfs merge=lfs -text
pytorch_model-00002-of-00004.bin filter=lfs diff=lfs merge=lfs -text
pytorch_model-00003-of-00004.bin filter=lfs diff=lfs merge=lfs -text
pytorch_model-00004-of-00004.bin filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

88
README.md Normal file
View File

@@ -0,0 +1,88 @@
---
license: llama3.1
language:
- en
pipeline_tag: text-generation
library_name: transformers
---
![czsdca.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/vcCVfEFpN-UQ_ZX7D-tUZ.png)
# **Llama3.1-8B-Grpo-Reasoning**
> The **Llama3.1-8B-Grpo-Reasoning** is a fine-tuned version of the **Llama-3.1-8B** base model, further enhanced with the **GSM8K dataset** for superior text generation and mathematical reasoning. This model is designed for advanced reasoning, structured problem-solving, and contextually rich outputs, making it an excellent choice for applications in **education, programming, research, and creative writing**.
With its optimized architecture, **Llama3.1-8B-Grpo-Reasoning** excels at:
- **Logical reasoning** and **step-by-step problem-solving**
- **Mathematical and coding tasks**, leveraging specialized expert models
- **Generating long-form content** (up to 8K tokens) with improved coherence
- **Understanding structured data**, including tables and JSON outputs
- **Following instructions** and **adapting to diverse system prompts**, making it ideal for chatbots and AI assistants
## **Key Features**
- **Supports long-context processing** of up to **128K tokens**
- **Fine-tuned using Supervised Fine-Tuning (SFT) and Reinforcement Learning with Human Feedback (RLHF)**
## **Model Architecture**
Llama3.1-8B-Grpo-Reasoning is built on the optimized transformer architecture of **Llama-3.1-8B**, integrating **enhanced dataset logits from GSM8K** for better mathematical reasoning and structured output generation.
## **Using with transformers**
To run conversational inference using `transformers >= 4.43.0`, use the `pipeline` abstraction or leverage the `generate()` function with the Auto classes.
Ensure your environment is updated with:
```bash
pip install --upgrade transformers
```
### **Example Usage**
```python
import torch
from transformers import pipeline
model_id = "prithivMLmods/Llama3.1-8B-Grpo-Reasoning"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
```
## **Intended Use**
**Llama3.1-8B-Grpo-Reasoning** is designed for a wide range of applications requiring deep reasoning, structured outputs, and logical text generation. It is particularly suited for:
- **Education & Research**: Generating detailed explanations, step-by-step solutions, and structured academic content.
- **Programming & Code Generation**: Assisting in code writing, debugging, and algorithm explanations with improved logic structuring.
- **AI Chatbots & Assistants**: Providing context-aware, instruction-following responses for conversational AI applications.
- **Creative Writing**: Generating high-quality stories, articles, and structured narratives with coherence.
- **Data Analysis & Structured Output Generation**: Interpreting and generating JSON, tables, and formatted outputs for structured data processing.
## **Limitations**
While **Llama3.1-8B-Grpo-Reasoning** is optimized for deep reasoning and structured outputs, it has some limitations:
1. **Not a Real-time Knowledge Source**
- The model is trained on a fixed dataset and does not have real-time internet access. It may not provide up-to-date information on rapidly evolving topics.
2. **Potential Biases**
- As with all AI models, responses may reflect biases present in the training data. Users should critically evaluate outputs, especially in sensitive domains.
3. **Mathematical & Logical Reasoning Constraints**
- While strong in step-by-step reasoning, it may occasionally produce incorrect mathematical calculations or logical inconsistencies. External verification is recommended for critical applications.
4. **Handling of Extremely Long Contexts**
- While it supports up to 128K tokens, efficiency and coherence may degrade when processing very long documents or conversations.
5. **Limited Handling of Ambiguity**
- The model may struggle with highly ambiguous or context-dependent queries, sometimes generating plausible but incorrect responses.
6. **Ethical & Compliance Considerations**
- Not intended for generating misinformation, automating legal or medical decisions, or other high-risk applications without human oversight.

39
config.json Normal file
View File

@@ -0,0 +1,39 @@
{
"_name_or_path": "unsloth/meta-llama-3.1-8b-instruct-unsloth-bnb-4bit",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"eos_token_id": 128009,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 4096,
"initializer_range": 0.02,
"intermediate_size": 14336,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 8,
"pad_token_id": 128004,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": {
"factor": 8.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_type": "llama3"
},
"rope_theta": 500000.0,
"tie_word_embeddings": false,
"torch_dtype": "float16",
"transformers_version": "4.48.3",
"unsloth_fixed": true,
"unsloth_version": "2025.3.14",
"use_cache": true,
"vocab_size": 128256
}

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"framework": "pytorch", "task": "others", "allow_remote": true}

8
generation_config.json Normal file
View File

@@ -0,0 +1,8 @@
{
"_from_model_config": true,
"bos_token_id": 128000,
"eos_token_id": 128009,
"max_length": 131072,
"pad_token_id": 0,
"transformers_version": "4.48.3"
}

View File

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

View File

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

View File

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

View File

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

View File

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

23
special_tokens_map.json Normal file
View File

@@ -0,0 +1,23 @@
{
"bos_token": {
"content": "<|begin_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|eot_id|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|finetune_right_pad_id|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

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

2067
tokenizer_config.json Normal file

File diff suppressed because it is too large Load Diff