Instructions to use NovaAI6868/BaiHu-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NovaAI6868/BaiHu-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf NovaAI6868/BaiHu-gguf:F16 # Run inference directly in the terminal: llama cli -hf NovaAI6868/BaiHu-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf NovaAI6868/BaiHu-gguf:F16 # Run inference directly in the terminal: llama cli -hf NovaAI6868/BaiHu-gguf:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf NovaAI6868/BaiHu-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf NovaAI6868/BaiHu-gguf:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf NovaAI6868/BaiHu-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf NovaAI6868/BaiHu-gguf:F16
Use Docker
docker model run hf.co/NovaAI6868/BaiHu-gguf:F16
- LM Studio
- Jan
- vLLM
How to use NovaAI6868/BaiHu-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NovaAI6868/BaiHu-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NovaAI6868/BaiHu-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/NovaAI6868/BaiHu-gguf:F16
- Ollama
How to use NovaAI6868/BaiHu-gguf with Ollama:
ollama run hf.co/NovaAI6868/BaiHu-gguf:F16
- Unsloth Studio
How to use NovaAI6868/BaiHu-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for NovaAI6868/BaiHu-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for NovaAI6868/BaiHu-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for NovaAI6868/BaiHu-gguf to start chatting
- Pi
How to use NovaAI6868/BaiHu-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NovaAI6868/BaiHu-gguf:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "NovaAI6868/BaiHu-gguf:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use NovaAI6868/BaiHu-gguf with Docker Model Runner:
docker model run hf.co/NovaAI6868/BaiHu-gguf:F16
- Lemonade
How to use NovaAI6868/BaiHu-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NovaAI6868/BaiHu-gguf:F16
Run and chat with the model
lemonade run user.BaiHu-gguf-F16
List all available models
lemonade list
- Hermes Agent
How to use NovaAI6868/BaiHu-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NovaAI6868/BaiHu-gguf:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default NovaAI6868/BaiHu-gguf:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use NovaAI6868/BaiHu-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf NovaAI6868/BaiHu-gguf:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "NovaAI6868/BaiHu-gguf:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,141 +1,103 @@
|
|
| 1 |
-
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
- chinese
|
| 6 |
-
- qa
|
| 7 |
-
- gpt
|
| 8 |
-
- transformer
|
| 9 |
-
- conversational-ai
|
| 10 |
-
- question-answering
|
| 11 |
-
- pytorch
|
| 12 |
-
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
##
|
| 24 |
|
| 25 |
-
|
| 26 |
-
-
|
| 27 |
-
-
|
| 28 |
-
-
|
| 29 |
-
|
| 30 |
-
- **Task**: Question Answering / Conversational AI
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
| 35 |
-
- **12 Transformer layers** with causal self-attention
|
| 36 |
-
- **12 attention heads** per layer
|
| 37 |
-
- **768-dimensional embeddings**
|
| 38 |
-
- **SentencePiece tokenizer** with BPE encoding for Chinese text
|
| 39 |
-
- **GELU activation functions**
|
| 40 |
-
- **Layer normalization** and residual connections
|
| 41 |
|
| 42 |
-
##
|
| 43 |
|
| 44 |
-
|
| 45 |
-
-
|
| 46 |
-
-
|
| 47 |
-
-
|
| 48 |
-
-
|
| 49 |
-
- Relationships and social advice
|
| 50 |
-
- General knowledge questions
|
| 51 |
|
| 52 |
-
|
| 53 |
|
| 54 |
-
|
| 55 |
-
- **Batch Size**: 4
|
| 56 |
-
- **Learning Rate**: 3e-4 (AdamW optimizer)
|
| 57 |
-
- **Epochs**: 3
|
| 58 |
-
- **Dropout**: 0.1
|
| 59 |
-
- **Gradient Clipping**: 1.0
|
| 60 |
|
| 61 |
-
##
|
| 62 |
|
| 63 |
-
|
| 64 |
-
```bash
|
| 65 |
-
pip install torch sentencepiece tqdm
|
| 66 |
-
```
|
| 67 |
|
| 68 |
-
### Training
|
| 69 |
```bash
|
| 70 |
-
|
|
|
|
| 71 |
```
|
| 72 |
|
| 73 |
-
###
|
|
|
|
| 74 |
```bash
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
```
|
| 77 |
|
| 78 |
-
###
|
| 79 |
-
```python
|
| 80 |
-
import torch
|
| 81 |
-
import sentencepiece as spm
|
| 82 |
-
from train import GPT, GPTConfig
|
| 83 |
-
|
| 84 |
-
# Load model
|
| 85 |
-
sp = spm.SentencePieceProcessor()
|
| 86 |
-
sp.Load('spm.model')
|
| 87 |
-
|
| 88 |
-
checkpoint = torch.load('checkpoints/checkpoint_epoch3.pt')
|
| 89 |
-
config = GPTConfig(
|
| 90 |
-
vocab_size=32000,
|
| 91 |
-
n_layer=12,
|
| 92 |
-
n_head=12,
|
| 93 |
-
n_embd=768,
|
| 94 |
-
block_size=1024
|
| 95 |
-
)
|
| 96 |
-
model = GPT(config)
|
| 97 |
-
model.load_state_dict(checkpoint['model_state'])
|
| 98 |
-
|
| 99 |
-
# Generate response
|
| 100 |
-
prompt = "你好,请介绍一下你自己"
|
| 101 |
-
ids = sp.EncodeAsIds('<s>' + prompt + '<sep>')
|
| 102 |
-
# ... generation logic
|
| 103 |
-
```
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
-
|
| 108 |
-
- Chinese language understanding
|
| 109 |
-
- Contextual question answering
|
| 110 |
-
- Conversational response generation
|
| 111 |
-
- Maintaining coherence over multi-turn conversations
|
| 112 |
|
| 113 |
-
##
|
| 114 |
|
| 115 |
-
- **
|
| 116 |
-
- **
|
| 117 |
-
- **
|
| 118 |
-
- **
|
| 119 |
-
- **Bias**: May reflect biases present in training data
|
| 120 |
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
| 124 |
-
- The model may generate responses that seem authoritative but could be factually incorrect
|
| 125 |
-
- The model's training data may contain biases
|
| 126 |
-
- Generated content should be fact-checked before use in critical applications
|
| 127 |
|
| 128 |
-
|
|
|
|
|
|
|
| 129 |
|
| 130 |
-
-
|
| 131 |
-
- **PyTorch**: Latest stable version
|
| 132 |
-
- **CUDA**: Optional, for GPU acceleration
|
| 133 |
-
- **Memory**: ~2GB GPU memory for inference
|
| 134 |
|
| 135 |
-
##
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
---
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BaiHu-v2
|
| 2 |
+
|
| 3 |
+
BaiHu-v2 是一款基于 **Google Gemma 4** 架构的多模态大语言模型,支持文本、图像、音频与视频输入,适用于中文场景下的多模态理解与生成任务。
|
| 4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
+
## 模型简介
|
| 8 |
|
| 9 |
+
- **模型名称**: BaiHu-v2
|
| 10 |
+
- **基座模型**: `unsloth/gemma-4-E2B-it`
|
| 11 |
+
- **架构**: `Gemma4ForConditionalGeneration`
|
| 12 |
+
- **上下文长度**: 131,072 tokens
|
| 13 |
+
- **词表大小**: 262,144
|
| 14 |
+
- **数据类型**: float16
|
| 15 |
+
- **支持模态**: 文本 / 图像 / 音频 / 视频
|
| 16 |
|
| 17 |
+
BaiHu-v2 在 Gemma 4 的多模态能力基础上进行了继续训练/微调,保留了原生 Gemma 4 对图像、音频、视频的理解能力,同时针对中文任务进行了优化。
|
| 18 |
|
| 19 |
+
---
|
| 20 |
|
| 21 |
+
## 仓库文件说明
|
| 22 |
|
| 23 |
+
| 文件 | 说明 |
|
| 24 |
+
|------|------|
|
| 25 |
+
| `BaiHu-v2.Q4_K_M.gguf` | 主模型 GGUF 量化版本(Q4_K_M),适合本地 CPU/GPU 推理 |
|
| 26 |
+
| `BaiHu-v2.F16-mmproj.gguf` | 多模态投影层(mmproj)FP16 版本,配合主模型用于图像/音频/视频理解 |
|
| 27 |
+
| `Modelfile` | llama.cpp / Ollama 的模型配置文件示例 |
|
|
|
|
| 28 |
|
| 29 |
+
> 推荐搭配使用:`BaiHu-v2.Q4_K_M.gguf` + `BaiHu-v2.F16-mmproj.gguf`
|
| 30 |
|
| 31 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
## 模型能力
|
| 34 |
|
| 35 |
+
- 中文多轮对话
|
| 36 |
+
- 图像描述与视觉问答
|
| 37 |
+
- 音频内容理解
|
| 38 |
+
- 视频内容理解
|
| 39 |
+
- 工具调用(遵循 Gemma 4 原生工具调用格式)
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
---
|
| 42 |
|
| 43 |
+
## 使用方法
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
### 使用 llama.cpp / Ollama 推理
|
| 46 |
|
| 47 |
+
参考仓库中的 `Modelfile` 创建 Ollama 模型:
|
|
|
|
|
|
|
|
|
|
| 48 |
|
|
|
|
| 49 |
```bash
|
| 50 |
+
ollama create BaiHu-v2 -f Modelfile
|
| 51 |
+
ollama run BaiHu-v2
|
| 52 |
```
|
| 53 |
|
| 54 |
+
### 使用 llama.cpp 命令行
|
| 55 |
+
|
| 56 |
```bash
|
| 57 |
+
./llama-cli \
|
| 58 |
+
-m BaiHu-v2.Q4_K_M.gguf \
|
| 59 |
+
--mmproj BaiHu-v2.F16-mmproj.gguf \
|
| 60 |
+
--image example.jpg \
|
| 61 |
+
-p "请描述这张图片:"
|
| 62 |
```
|
| 63 |
|
| 64 |
+
### 使用 transformers(完整模型)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
完整 PyTorch/Safetensors 版本请参考配套仓库。本仓库仅提供 GGUF 量化版本。
|
| 67 |
|
| 68 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
+
## 模型配置
|
| 71 |
|
| 72 |
+
- **文本模型**: Gemma 4 Text,35 层,隐藏维度 1536,8 头注意力
|
| 73 |
+
- **视觉编码器**: Gemma 4 Vision,16 层,隐藏维度 768,图像 token 数 280
|
| 74 |
+
- **音频编码器**: Gemma 4 Audio,12 层,隐藏维度 1024
|
| 75 |
+
- **视频**: 支持 32 帧采样,每帧最大 70 个 soft token
|
|
|
|
| 76 |
|
| 77 |
+
---
|
| 78 |
|
| 79 |
+
## 训练信息
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
- **训练框架**: Unsloth
|
| 82 |
+
- **Unsloth 版本**: 2026.6.8
|
| 83 |
+
- **优化目标**: 在保持多模态能力的同时,提升中文指令跟随与对话质量
|
| 84 |
|
| 85 |
+
---
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
## 免责声明
|
| 88 |
|
| 89 |
+
本模型基于 Gemma 4 进行微调,生成的内容可能受训练数据影响。请勿将模型输出作为专业建议(医疗、法律、金融等)使用。模型可能存在幻觉、偏见或不准确信息,请谨慎使用并自行验证。
|
| 90 |
|
| 91 |
---
|
| 92 |
+
|
| 93 |
+
## 授权协议
|
| 94 |
+
|
| 95 |
+
本模型基于 Google Gemma 4 构建,遵循 Gemma 模型的相关许可协议。请在使用前仔细阅读并遵守相关条款。
|
| 96 |
+
|
| 97 |
---
|
| 98 |
+
|
| 99 |
+
## 致谢
|
| 100 |
+
|
| 101 |
+
- [Google Gemma](https://ai.google.dev/gemma)
|
| 102 |
+
- [Unsloth](https://unsloth.ai/)
|
| 103 |
+
- [llama.cpp](https://github.com/ggerganov/llama.cpp)
|