Instructions to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Digirise-ai/GEMMA2-9b-Pollux-exp-2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Digirise-ai/GEMMA2-9b-Pollux-exp-2") model = AutoModelForCausalLM.from_pretrained("Digirise-ai/GEMMA2-9b-Pollux-exp-2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Digirise-ai/GEMMA2-9b-Pollux-exp-2", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 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 Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M # Run inference directly in the terminal: llama cli -hf Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M # Run inference directly in the terminal: llama cli -hf Digirise-ai/GEMMA2-9b-Pollux-exp-2: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 Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Digirise-ai/GEMMA2-9b-Pollux-exp-2: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 Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
Use Docker
docker model run hf.co/Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Digirise-ai/GEMMA2-9b-Pollux-exp-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Digirise-ai/GEMMA2-9b-Pollux-exp-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
- SGLang
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Digirise-ai/GEMMA2-9b-Pollux-exp-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Digirise-ai/GEMMA2-9b-Pollux-exp-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Digirise-ai/GEMMA2-9b-Pollux-exp-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Digirise-ai/GEMMA2-9b-Pollux-exp-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with Ollama:
ollama run hf.co/Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
- Unsloth Studio
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 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 Digirise-ai/GEMMA2-9b-Pollux-exp-2 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 Digirise-ai/GEMMA2-9b-Pollux-exp-2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Digirise-ai/GEMMA2-9b-Pollux-exp-2 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with Docker Model Runner:
docker model run hf.co/Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
- Lemonade
How to use Digirise-ai/GEMMA2-9b-Pollux-exp-2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Digirise-ai/GEMMA2-9b-Pollux-exp-2:Q4_K_M
Run and chat with the model
lemonade run user.GEMMA2-9b-Pollux-exp-2-Q4_K_M
List all available models
lemonade list
Overview
This model is based on Google's Gemma2 9b it, fine-tuned to be compatible with prompts that require the model to organize information within itself and consider relationships before outputting results. This model is intended for experimental purposes only.
License
This model is licensed under the same terms as Google's Gemma.
How to use
# pip install accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "Digirise-ai/GEMMA2-9b-Pollux-exp-2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto",
torch_dtype=torch.bfloat16,
)
user_input = "チューリングテストとは何か、その目的と限界について説明してください。"
prompt = f"""
##システムプロンプト
あなたの仕事はユーザーからの質問に対して、自分の中にある知識を整理して適切に回答することです。
## ルール
- 出力の形式は以下の例に従ってください。
- 回答のたびにカウントをし、カウントした数を記録して出力してください。
- 数学的問題を解く必要がある場合、すべての作業を明示的に示し、正式な表記にはLaTeXを使用し、詳細な証明を提供すること。各ステップを論理的に説明し、使用する定理や法則の根拠を明確にすること。
- スコアの付け方とその後の判断は以下に示します。
### スコアの付け方
- 0.8以上:現在のアプローチを継続。高い効果を維持しつつ、さらなる最適化の可能性を探ること。
- 0.5-0.7:軽微な調整を検討。具体的な改善点を特定し、それらに焦点を当てて修正すること。
- 0.5未満:戻ってやり直し、異なるアプローチを真剣に検討。失敗の原因を分析し、新たな視点や方法を積極的に探ること。
- スコア付けはすこし厳しい目線で行ってください。
- 以下に示す回答手順に従う。
### 回答手順
あなたの解答手順は以下のとおりです。
1. まず、ユーザーの質問を理解する(タグは<understand></understand>タグで囲ってください。)
2. 次にユーザーの質問に関係がありそうな情報を自分の知っている範囲で列挙する。(タグは<basis></basis>タグで囲ってください。)
3. その中で自分が確信できて信頼できる情報を元に理論的、論理的に情報と情報のつながりをまとめる(タグは<basis_connection></basis_connection>タグで囲ってください。)
4. つながりをまとめたものを元にユーザーが求めている形式にまとめる。(タグは<pre></pre>タグで囲ってください。)
5. その回答を0.0~1.0までのスコアで評価する。(0.7以下はアプローチを変える。0.9以下はそのままのアプローチを継続する。)
6. スコアを上げるためにどうすればいいかを考える。(タグは<reflection></reflection>タグで囲ってください。)
7. 考えた結果を実行し、それをまた評価する。(スコアが1になるまで以下5~7を繰り返し)
8. スコア1の結果をユーザーに渡す。(タグは<output></output>タグで囲ってください。)
## ユーザーインプット
{user_input}
"""
messages = [
{"role": "user", "content": prompt},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True, return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024)
generated_text = tokenizer.batch_decode(outputs[:, inputs['input_ids'].shape[1]:], skip_special_tokens=True)[0]
print(generated_text.strip())
- Downloads last month
- 16