Instructions to use QuantFactory/sarashina2-7b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use QuantFactory/sarashina2-7b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/sarashina2-7b-GGUF", filename="sarashina2-7b.Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use QuantFactory/sarashina2-7b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M
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 QuantFactory/sarashina2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M
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 QuantFactory/sarashina2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/sarashina2-7b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/sarashina2-7b-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use QuantFactory/sarashina2-7b-GGUF with Ollama:
ollama run hf.co/QuantFactory/sarashina2-7b-GGUF:Q4_K_M
- Unsloth Studio new
How to use QuantFactory/sarashina2-7b-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 QuantFactory/sarashina2-7b-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 QuantFactory/sarashina2-7b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/sarashina2-7b-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/sarashina2-7b-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/sarashina2-7b-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/sarashina2-7b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/sarashina2-7b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.sarashina2-7b-GGUF-Q4_K_M
List all available models
lemonade list
QuantFactory/sarashina2-7b-GGUF
This is quantized version of sbintuitions/sarashina2-7b created using llama.cpp
Original Model Card
Sarashina2-7B
This repository provides large language models trained by SB Intuitions.
How to use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, set_seed
model = AutoModelForCausalLM.from_pretrained("sbintuitions/sarashina2-7b", torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("sbintuitions/sarashina2-7b")
# If you want to use slow tokenizer
# tokenizer = AutoTokenizer.from_pretrained("sbintuitions/sarashina2-7b", use_fast=False)
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
set_seed(123)
text = generator(
"おはようございます、今日の天気は",
max_length=30,
do_sample=True,
pad_token_id=tokenizer.pad_token_id,
num_return_sequences=3,
)
for t in text:
print(t)
# These examples are generated by sarashina2-7b parameters model
# {'generated_text': 'おはようございます、今日の天気は晴れです。ちょっと風が強い。\n昨日は、久しぶりにゆっくりとしていました。\n2週間位間があいてしまったかも、でもその間に'}
# {'generated_text': 'おはようございます、今日の天気は曇。朝は曇っていてどんよりしていましたね。昼からは晴れそうですが。気温は徐々に上昇しています。昨日は春らしい陽気でした。'}
# {'generated_text': 'おはようございます、今日の天気はくもり、少し寒気がします。 この土日に、家族で一泊二日で旅行に行ってきました。といっても、100キロ'}
Configuration
| Parameters | Vocab size | Training tokens | Architecture | Position type | Layers | Hidden dim | Attention heads |
|---|---|---|---|---|---|---|---|
| 7B | 102400 | 2.1T | Llama2 | RoPE | 32 | 4096 | 32 |
| 13B | 102400 | 2.1T | Llama2 | RoPE | 40 | 5120 | 40 |
| 70B | 102400 | 2.1T | Llama2 | RoPE | 80 | 8192 | 64 |
Training Corpus
For our Japanese training data, we used a Japanese portion of the Common Crawl corpus, which is the largest Web corpus, as our training dataset. To clean the training corpus, we used CCNet and HojiChar. After cleaning, our Japanese training data contains about 1T tokens.
For our English training data, we extracted English documents from SlimPajama but we removed books3 corpus due to copyright infringement.
Tokenization
We use a sentencepiece tokenizer with a unigram language model and byte-fallback. We do not apply pre-tokenization with Japanese tokenizer. Thus, a user may directly feed raw sentences into the tokenizer.
Ethical Considerations and Limitations
Sarashina2 has not been tuned to follow an instruction yet. Therefore, sarashina2 might generate some meaningless sequences, some inaccurate instances or biased/objectionable outputs. Before using sarashina2, we would like developers to tune models based on human preferences and safety considerations.
License
- Downloads last month
- 25
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit