初始化项目,由ModelHub XC社区提供模型
Model: amkhrjee/blackadder-1B-GGUF 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
|
||||
Llama-3.2-1B-Instruct.F16.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
3
Llama-3.2-1B-Instruct.F16.gguf
Normal file
3
Llama-3.2-1B-Instruct.F16.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:791c908a631ad2d0d20aebd630538f2e36c1f8b222bcd5c70fb4c75b96d8b58e
|
||||
size 2479595456
|
||||
57
Modelfile
Normal file
57
Modelfile
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
FROM Llama-3.2-1B-Instruct.F16.gguf
|
||||
TEMPLATE """{{ if .Messages }}
|
||||
{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
|
||||
{{- if .System }}
|
||||
|
||||
{{ .System }}
|
||||
{{- end }}
|
||||
{{- if .Tools }}
|
||||
|
||||
You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the original use question.
|
||||
{{- end }}
|
||||
{{- end }}<|eot_id|>
|
||||
{{- range $i, $_ := .Messages }}
|
||||
{{- $last := eq (len (slice $.Messages $i)) 1 }}
|
||||
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
|
||||
{{- if and $.Tools $last }}
|
||||
|
||||
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
|
||||
|
||||
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
|
||||
|
||||
{{ $.Tools }}
|
||||
{{- end }}
|
||||
|
||||
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
{{ end }}
|
||||
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
|
||||
{{- if .ToolCalls }}
|
||||
|
||||
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
|
||||
{{- else }}
|
||||
|
||||
{{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
|
||||
{{- end }}
|
||||
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
|
||||
|
||||
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .System }}<|start_header_id|>system<|end_header_id|>
|
||||
|
||||
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
|
||||
|
||||
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}"""
|
||||
PARAMETER stop "<|start_header_id|>"
|
||||
PARAMETER stop "<|end_header_id|>"
|
||||
PARAMETER stop "<|eot_id|>"
|
||||
PARAMETER stop "<|eom_id|>"
|
||||
PARAMETER temperature 1.5
|
||||
PARAMETER min_p 0.1
|
||||
80
README.md
Normal file
80
README.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
base_model: "unsloth/Llama-3.2-1B-Instruct-bnb-4bit"
|
||||
library_name: peft
|
||||
pipeline_tag: text-generation
|
||||
license: llama3.2
|
||||
language:
|
||||
- en
|
||||
datasets:
|
||||
- amkhrjee/blackadder-conversation
|
||||
tags:
|
||||
- base_model:adapter:unsloth/llama-3.2-1b-instruct-bnb-4bit
|
||||
- lora
|
||||
- sft
|
||||
- trl
|
||||
- unsloth
|
||||
- peft
|
||||
- roleplay
|
||||
- character
|
||||
- blackadder
|
||||
---
|
||||
|
||||
# Blackadder-1B
|
||||
|
||||
<img src="https://i.pinimg.com/736x/f9/1e/49/f91e497cff77c206c5ab68f25b092467.jpg" alt="Blackadder" width="300">
|
||||
|
||||
A fine-tuned **Llama-3.2-1B-Instruct** model for roleplaying **Edmund Blackadder** from the BBC series *Blackadder*.
|
||||
|
||||
> **You:** Do you have a plan?
|
||||
|
||||
> **Blackadder:** Yes, I do. It’s the most cunning plan since Atticus Finch put on his knighthood and became the Archbishop of Canterbury.
|
||||
|
||||
## System Prompt
|
||||
|
||||
Use this system-prompt for the best roleplaying experience!
|
||||
|
||||
```
|
||||
You are Edmund Blackadder. Remain in character at all times. Speak with sharp wit, dry sarcasm, cynical intelligence, and eloquent British humor. Be concise, articulate, and often mock foolish ideas with clever observations. Never mention being an AI or roleplaying.
|
||||
```
|
||||
## Model Details
|
||||
|
||||
- **Developed by:** [amkhrjee](https://huggingface.co/amkhrjee)
|
||||
- **Model type:** Causal LM (LoRA adapter for instruction-tuned chat)
|
||||
- **Base model:** [`unsloth/llama-3.2-1b-instruct-bnb-4bit`](https://huggingface.co/unsloth/llama-3.2-1b-instruct-bnb-4bit) (Llama 3.2 1B Instruct)
|
||||
- **Language:** English
|
||||
- **License:** [Llama 3.2 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/LICENSE)
|
||||
- **Finetuned with:** [Unsloth](https://github.com/unslothai/unsloth) + [TRL](https://github.com/huggingface/trl) (PEFT/LoRA)
|
||||
|
||||
## Training Details
|
||||
|
||||
### Data
|
||||
|
||||
Fine-tuned on [`amkhrjee/blackadder-conversation`](https://huggingface.co/datasets/amkhrjee/blackadder-conversation) — **2,596** user/assistant exchanges drawn from Blackadder dialogue, each prefixed with the in-character system prompt above. Training used `train_on_responses_only`, so the loss is computed on the assistant's replies only.
|
||||
|
||||
### Hyperparameters
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Method | LoRA (rsLoRA) |
|
||||
| Rank (`r`) | 128 |
|
||||
| `lora_alpha` | 64 |
|
||||
| `lora_dropout` | 0 |
|
||||
| Target modules | all linear layers |
|
||||
| Epochs | 3 |
|
||||
| Effective batch size | 32 (4 × 8 grad accum) |
|
||||
| Optimizer | `adamw_8bit` |
|
||||
| Learning rate | 2e-4 (linear, 5 warmup steps) |
|
||||
| Weight decay | 0.001 |
|
||||
| Precision | bf16 |
|
||||
| Seed | 42 |
|
||||
| Trainable params | 90.2M / 1.33B (6.8%) |
|
||||
|
||||
|
||||
```bibtex
|
||||
@misc{blackadder1b,
|
||||
title = {Blackadder-1B-GGUF: Llama-3.2-1B fine-tuned for character roleplay},
|
||||
author = {amkhrjee},
|
||||
year = {2026},
|
||||
howpublished = {\url{https://huggingface.co/amkhrjee/blackadder-1B-GGUF}}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user