Instructions to use neph1/gemma-2-2b-dunsany with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use neph1/gemma-2-2b-dunsany with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="neph1/gemma-2-2b-dunsany")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("neph1/gemma-2-2b-dunsany") model = AutoModelForCausalLM.from_pretrained("neph1/gemma-2-2b-dunsany") - llama-cpp-python
How to use neph1/gemma-2-2b-dunsany with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="neph1/gemma-2-2b-dunsany", filename="gguf/gemma-2-2b-dunsany.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use neph1/gemma-2-2b-dunsany with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf neph1/gemma-2-2b-dunsany # Run inference directly in the terminal: llama-cli -hf neph1/gemma-2-2b-dunsany
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf neph1/gemma-2-2b-dunsany # Run inference directly in the terminal: llama-cli -hf neph1/gemma-2-2b-dunsany
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 neph1/gemma-2-2b-dunsany # Run inference directly in the terminal: ./llama-cli -hf neph1/gemma-2-2b-dunsany
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 neph1/gemma-2-2b-dunsany # Run inference directly in the terminal: ./build/bin/llama-cli -hf neph1/gemma-2-2b-dunsany
Use Docker
docker model run hf.co/neph1/gemma-2-2b-dunsany
- LM Studio
- Jan
- vLLM
How to use neph1/gemma-2-2b-dunsany with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "neph1/gemma-2-2b-dunsany" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neph1/gemma-2-2b-dunsany", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/neph1/gemma-2-2b-dunsany
- SGLang
How to use neph1/gemma-2-2b-dunsany 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 "neph1/gemma-2-2b-dunsany" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neph1/gemma-2-2b-dunsany", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "neph1/gemma-2-2b-dunsany" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neph1/gemma-2-2b-dunsany", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use neph1/gemma-2-2b-dunsany with Ollama:
ollama run hf.co/neph1/gemma-2-2b-dunsany
- Unsloth Studio
How to use neph1/gemma-2-2b-dunsany 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 neph1/gemma-2-2b-dunsany 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 neph1/gemma-2-2b-dunsany to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for neph1/gemma-2-2b-dunsany to start chatting
- Docker Model Runner
How to use neph1/gemma-2-2b-dunsany with Docker Model Runner:
docker model run hf.co/neph1/gemma-2-2b-dunsany
- Lemonade
How to use neph1/gemma-2-2b-dunsany with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull neph1/gemma-2-2b-dunsany
Run and chat with the model
lemonade run user.gemma-2-2b-dunsany-{{QUANT_TAG}}List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf neph1/gemma-2-2b-dunsany# Run inference directly in the terminal:
llama-cli -hf neph1/gemma-2-2b-dunsanyUse 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 neph1/gemma-2-2b-dunsany# Run inference directly in the terminal:
./llama-cli -hf neph1/gemma-2-2b-dunsanyBuild 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 neph1/gemma-2-2b-dunsany# Run inference directly in the terminal:
./build/bin/llama-cli -hf neph1/gemma-2-2b-dunsanyUse Docker
docker model run hf.co/neph1/gemma-2-2b-dunsanyThis is just a small fun project to test out continuous pretraining. I wanted to see if I could make a small model output stories in the style of one of my favorite authors, Lord Dunsany.
It's a rather small dataset, 52 short stories from "Gods of Pegana" and "Time and the Gods". I did not include "Book of Wonders", at least not this time.
Uploaded model
- Developed by: neph1
- License: apache-2.0
- Finetuned from model : unsloth/gemma-2-2b-bnb-4bit
This gemma2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Examples:
Cherry-picked, 1 out of 3. Input in bold
It was such, that in the deep desert, where few men dared journey with their caravans, there was one man who had not journeyed with them. And this man's name was the Ptah-hotep, and he had been a prophet of the gods before the other prophets had appeared.
And it had once been the will of Thoth that Ptah-hotep should be a prophet when all the other prophets were gone—but after some time he had forgotten, and did not desire to have him any longer among his prophets. But no sooner had the other prophets been sent away than the voice of Thoth said: “Ptah-hotep is still a prophet.”
And so Ptah-hotep went upon his journeys into the world, for Ptah-hotep knew how to read writing, though the other prophets could not read nor write.
And as Ptah-hotep traveled over the face of the earth he found many strange things, but mostly old things. And Ptah-hotep wrote down what he saw, and told other men about them. Only he never forgot who was his master. For every day he carried with him two things, and made sure that they should always accompany him as long as he lived; those things were his two scrolls, which held his writings about the world.
One scroll he wrote upon, and it was called The Scroll that tells of All Things; and in it are the names of all the hills and mountains, and of the valleys and plains, and of the forests, and of the rivers and streams.
But only the gods know how this scroll came into being. It may be that Ptah-hotep first wrote it out by himself. It may be that Ptah-hotep stole it from the hand of Thoth, or borrowed it from the scribes whom the gods have appointed to keep sacred record of such things as Ptah-hotep has written concerning the land.
In The Scroll that tells of All Things are the names of all the cities and towns that lie on the face of the earth, and of all the villages, and of the caves where there is shelter for man. But there are no names in that scroll of the huts wherein the people sleep, nor of the little houses where children play together, nor of the walls and gates where none go, nor even of the tombs where their bones are laid away. Nor does Ptah-hotep write anything about the ships that sail upon the sea, though he knows the names of the captains of those ships, and of the sailors who fight aboard them, and of the great captain of the ship that sails over the dark waters toward the land of the setting sun.
And so also with the plants and the animals that live on the earth, and with all other things that spring up from the ground, or fly through the air, or swim beneath the waves. They have no names except in The Scroll that tells of All Things. And it may be that when Ptah-hotep dies they will forget the names of men, but not the names of the hills and mountains, and of the rivers and streams, nor the names of the trees, nor the names of the flowers, nor the names of the grass. For some years after his death perhaps the name of Man shall yet be remembered; but after a time the name of Ptah-hotep shall be forgotten, and only The Scroll that tells of All Things shall be remembered, and afterward there shall be nothing else to tell of the days of men.
- Downloads last month
- 13
We're not able to determine the quantization variants.

Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf neph1/gemma-2-2b-dunsany# Run inference directly in the terminal: llama-cli -hf neph1/gemma-2-2b-dunsany