Files
Gemmalpaca-7B/README.md
ModelHub XC ad5150a26c 初始化项目,由ModelHub XC社区提供模型
Model: mlabonne/Gemmalpaca-7B
Source: Original Platform
2026-10-18 08:30:13 +08:00

117 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
library_name: transformers
extra_gated_heading: Access Gemma on Hugging Face
extra_gated_prompt: >-
To access Gemma on Hugging Face, you’re required to review and agree to
Google’s usage license. To do this, please ensure you’re logged-in to Hugging
Face and click below. Requests are processed immediately.
extra_gated_button_content: Acknowledge license
license: other
license_name: gemma-terms-of-use
license_link: https://ai.google.dev/gemma/terms
base_model:
- google/gemma-7b
datasets:
- vicgalle/alpaca-gpt4
---
![image/webp](https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/uwPjZeV-JQwKWrI7nHg4w.webp)
# Gemmalpaca-7B
This is gemma-7b model supervised fine-tuned on the [vicgalle/alpaca-gpt4](https://huggingface.co/datasets/vicgalle/alpaca-gpt4) dataset. It outperforms gemma-7b-it, Google's chat version, on Nous' benchmark suite.
It's mostly a test to see how fine-tuning works with Gemma models on a well-known dataset.
## 🔍 Applications
This model has a context length of 8k. I recommend using it with the Alpaca chat template and NOT the Gemma Instruct template (works perfectly with LM Studio). You also want to add `</s>` as a stop token.
## 🏆 Evaluation
### Nous
Gemmalpaca-7B outperforms gemma-7b and gemma-7b-it on Nous' benchmark suite (evaluation performed using [LLM AutoEval](https://github.com/mlabonne/llm-autoeval)). See the entire leaderboard [here](https://huggingface.co/spaces/mlabonne/Yet_Another_LLM_Leaderboard).
| Model | Average | AGIEval | GPT4All | TruthfulQA | Bigbench |
|---|---:|---:|---:|---:|---:|
| [**mlabonne/Gemmalpaca-7B**](https://huggingface.co/mlabonne/Gemmalpaca-7B) [📄](https://gist.github.com/mlabonne/61622c46e53914a16e11be89d078f66c) | **34.45** | **21.6** | **40.87** | **44.85** | **30.49** |
| [google/gemma-2b](https://huggingface.co/google/gemma-2b) [📄](https://gist.github.com/mlabonne/7df1f238c515a5f63a750c8792cef59e) | 34.26 | 22.7 | 43.35 | 39.96 | 31.03 |
| [google/gemma-7b](https://huggingface.co/google/gemma-7b) [📄](https://gist.github.com/mlabonne/5f9855d341c3b11f775348ecb4fd8cf1) | 33.56 | 20.64 | 38.49 | 46.61 | 28.51 |
| [google/gemma-7b-it](https://huggingface.co/google/gemma-7b-it) [📄](https://gist.github.com/mlabonne/0fb752dc3c5b578fff87a73c56a16d7a) | 33.53 | 21.33 | 40.84 | 41.7 | 30.25 |
## 🧩 Configuration
It was trained using [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) with the following configuration.
```yaml
base_model: alpindale/gemma-7b
model_type: AutoModelForCausalLM
tokenizer_config: philschmid/gemma-tokenizer-chatml
tokenizer_type: AutoTokenizer
tokenizer_use_fast: true
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
- path: vicgalle/alpaca-gpt4
type: alpaca
dataset_prepared_path:
val_set_size: 0.01
output_dir: ./out
sequence_len: 2048
sample_packing: true
pad_to_sequence_len: true
adapter: qlora
lora_model_dir:
lora_r: 32
lora_alpha: 64
lora_dropout: 0.05
lora_target_linear: true
wandb_project: axolotl
wandb_entity:
wandb_watch:
wandb_name:
wandb_log_model:
gradient_accumulation_steps: 2
micro_batch_size: 4
num_epochs: 3
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.0002
train_on_inputs: false
group_by_length: false
bf16: auto
fp16:
tf32: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
warmup_steps: 10
evals_per_epoch: 10
eval_table_size:
eval_table_max_new_tokens: 128
saves_per_epoch: 1
debug:
deepspeed:
weight_decay: 0.1
fsdp:
fsdp_config:
special_tokens:
```
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)