Instructions to use zrrraa/E-Guide 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 zrrraa/E-Guide 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 zrrraa/E-Guide:F16 # Run inference directly in the terminal: llama cli -hf zrrraa/E-Guide:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf zrrraa/E-Guide:F16 # Run inference directly in the terminal: llama cli -hf zrrraa/E-Guide: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 zrrraa/E-Guide:F16 # Run inference directly in the terminal: ./llama-cli -hf zrrraa/E-Guide: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 zrrraa/E-Guide:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf zrrraa/E-Guide:F16
Use Docker
docker model run hf.co/zrrraa/E-Guide:F16
- LM Studio
- Jan
- vLLM
How to use zrrraa/E-Guide with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zrrraa/E-Guide" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zrrraa/E-Guide", "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/zrrraa/E-Guide:F16
- Ollama
How to use zrrraa/E-Guide with Ollama:
ollama run hf.co/zrrraa/E-Guide:F16
- Unsloth Desktop
- Pi
How to use zrrraa/E-Guide with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zrrraa/E-Guide: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": "zrrraa/E-Guide:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use zrrraa/E-Guide with Docker Model Runner:
docker model run hf.co/zrrraa/E-Guide:F16
- Lemonade
How to use zrrraa/E-Guide with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zrrraa/E-Guide:F16
Run and chat with the model
lemonade run user.E-Guide-F16
List all available models
lemonade list
- Hermes Agent
How to use zrrraa/E-Guide with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zrrraa/E-Guide: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 zrrraa/E-Guide:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use zrrraa/E-Guide with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zrrraa/E-Guide: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 "zrrraa/E-Guide: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"
File size: 4,100 Bytes
a1445bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | from unsloth import FastVisionModel # FastLanguageModel for LLMs
import torch
from datasets import load_dataset
from unsloth import is_bf16_supported
from unsloth.trainer import UnslothVisionDataCollator
from trl import SFTTrainer, SFTConfig
from transformers import TextStreamer
import datetime
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
model, tokenizer = FastVisionModel.from_pretrained(
model_name = "/home/rzhong/project/unsloth/model_pretrain_20250301_113944",
load_in_4bit = False, # Use 4bit to reduce memory use. False for 16bit LoRA.
# 模型已经选了4bit量化后的,这里还需不需要再以4bit加载?建议实验一下 | 应该是一个意思
use_gradient_checkpointing = "unsloth", # True or "unsloth" for long context
max_seq_length = 2048, # unsloth支持4x的上下文微调,如果原模型支持8192的上下文,这里只需要设置为2048
dtype = torch.bfloat16, # A100支持bfloat16,可以减少显存占用。默认为None,也可以选择torch.float16
)
model = FastVisionModel.get_peft_model(
model,
finetune_vision_layers = True, # False if not finetuning vision layers
finetune_language_layers = True, # False if not finetuning language layers
finetune_attention_modules = True, # False if not finetuning attention layers
finetune_mlp_modules = True, # False if not finetuning MLP layers
r = 16, # The larger, the higher the accuracy, but might overfit
lora_alpha = 16, # Recommended alpha == r at least
lora_dropout = 0,
bias = "none",
random_state = 3407,
use_rslora = False, # We support rank stabilized LoRA
loftq_config = None, # And LoftQ
# target_modules = "all-linear", # Optional now! Can specify a list if needed
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
)
dataset = load_dataset("/home/share/rzhong/dataset/google-landmark/dataset_4/dataset_file", split = "train")
print(dataset)
instruction = "描述这张图片。"
# instruction = "Write the LaTeX representation for this image."
def convert_to_conversation(sample):
conversation = [
{ "role": "user",
"content" : [
{"type" : "text", "text" : instruction},
{"type" : "image", "image" : sample["image"]} ]
},
{ "role" : "assistant",
"content" : [
{"type" : "text", "text" : sample["text"]} ]
},
]
return { "messages" : conversation }
pass
converted_dataset = [convert_to_conversation(sample) for sample in dataset]
print(converted_dataset[0])
FastVisionModel.for_training(model) # Enable for training!
trainer = SFTTrainer(
model = model,
tokenizer = tokenizer,
data_collator = UnslothVisionDataCollator(model, tokenizer), # Must use!
train_dataset = converted_dataset,
args = SFTConfig(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4, # 原来是4。可以增加,相当于提高batch size,但不会影响内存消耗。增加会使loss曲线更平滑
warmup_steps = 5,
# max_steps = None,
num_train_epochs = 10, # Set this instead of max_steps for full training runs
learning_rate = 5e-5, # 2e-4 1e-4 5e-5 2e-5
fp16 = not is_bf16_supported(),
bf16 = is_bf16_supported(),
logging_steps = 1,
optim = "adamw_8bit",
weight_decay = 0.01,
lr_scheduler_type = "linear",
seed = 3407,
output_dir = f"outputs_pretrain_sft_{timestamp}",
report_to = "none", # For Weights and Biases
# You MUST put the below items for vision finetuning:
remove_unused_columns = False,
dataset_text_field = "",
dataset_kwargs = {"skip_prepare_dataset": True},
dataset_num_proc = 4,
max_seq_length = 2048,
),
)
trainer_stats = trainer.train()
model.save_pretrained(f"lora_model_pretrain_sft_{timestamp}") # Local saving
tokenizer.save_pretrained(f"lora_model_pretrain_sft_{timestamp}") |