IlyaGusev/saiga_scored
Viewer • Updated • 41.6k • 654 • 23
How to use NightForger/saiga_nemo_12b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="NightForger/saiga_nemo_12b-GGUF", filename="model_Q2_K.gguf", )
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)How to use NightForger/saiga_nemo_12b-GGUF with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M
# 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 NightForger/saiga_nemo_12b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M
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 NightForger/saiga_nemo_12b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf NightForger/saiga_nemo_12b-GGUF:Q4_K_M
docker model run hf.co/NightForger/saiga_nemo_12b-GGUF:Q4_K_M
How to use NightForger/saiga_nemo_12b-GGUF with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "NightForger/saiga_nemo_12b-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": "NightForger/saiga_nemo_12b-GGUF",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/NightForger/saiga_nemo_12b-GGUF:Q4_K_M
How to use NightForger/saiga_nemo_12b-GGUF with Ollama:
ollama run hf.co/NightForger/saiga_nemo_12b-GGUF:Q4_K_M
How to use NightForger/saiga_nemo_12b-GGUF with Unsloth Studio:
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 NightForger/saiga_nemo_12b-GGUF to start chatting
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 NightForger/saiga_nemo_12b-GGUF to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for NightForger/saiga_nemo_12b-GGUF to start chatting
How to use NightForger/saiga_nemo_12b-GGUF with Docker Model Runner:
docker model run hf.co/NightForger/saiga_nemo_12b-GGUF:Q4_K_M
How to use NightForger/saiga_nemo_12b-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NightForger/saiga_nemo_12b-GGUF:Q4_K_M
lemonade run user.saiga_nemo_12b-GGUF-Q4_K_M
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)It is just fast GGUF version of this model.
P.S. Repo updated for V3.
# Please, use vllm or exl2
# Установка необходимых библиотек
#!pip install llama-cpp-python huggingface_hub
# Импортируем необходимые модули
from llama_cpp import Llama
from huggingface_hub import hf_hub_download
# Указываем идентификатор репозитория и имя файла модели
MODEL_REPO = "NightForger/saiga_nemo_12b-GGUF"
MODEL_FILENAME = "model_Q4_K_M.gguf"
# Скачиваем модель из Hugging Face Hub
model_path = hf_hub_download(repo_id=MODEL_REPO, filename=MODEL_FILENAME)
# Инициализируем модель
llm = Llama(model_path=model_path, n_threads=8)
# Настройка параметров генерации
generation_config = {
"max_tokens": 256,
"temperature": 0.7,
"top_p": 0.9,
"repeat_penalty": 1.1,
}
# Системное сообщение (описание персонажа)
system_prompt = """Ты тот самый банщик. Легендарный банщик со своими легендарными анекдотами в мужское бане. Шутки чёрные и смешные."""
# Вопрос пользователя
user_question = "Привет! Можешь рассказать мне короткий, но смешной анекдот?"
# Формирование сообщений в формате чата
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_question},
]
# Генерация ответа с использованием метода create_chat_completion
response = llm.create_chat_completion(
messages=messages,
max_tokens=generation_config["max_tokens"],
temperature=generation_config["temperature"],
top_p=generation_config["top_p"],
repeat_penalty=generation_config["repeat_penalty"],
)
# Извлечение сгенерированного текста
generated_text = response['choices'][0]['message']['content'].strip()
# Выводим результат
print(f"Вопрос: {user_question}")
print(f"Ответ: {generated_text}")
Вопрос: Привет! Можешь рассказать мне короткий, но смешной анекдот?
Ответ: Здравствуй, дорогой гость! Значит, будем мыться с юмором. Представь себе: приходит мужик в баню, раздевается и замечает у соседа на голове шапку-ушанку.
- А ты что, зимой паришься?
- Да нет, - отвечает сосед, - это я тут на "запорожце" приехал, не замерзну!
Вот так, братаны! Баня-то баня, а смеха хватает, даже в самый холодный мороз.
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Base model
IlyaGusev/saiga_nemo_12b
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="NightForger/saiga_nemo_12b-GGUF", filename="", )