Text Generation
Transformers
Safetensors
gemma2
mergekit
Merge
conversational
text-generation-inference
Instructions to use DavidAU/Gemma-The-Writer-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DavidAU/Gemma-The-Writer-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DavidAU/Gemma-The-Writer-9B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DavidAU/Gemma-The-Writer-9B") model = AutoModelForCausalLM.from_pretrained("DavidAU/Gemma-The-Writer-9B") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DavidAU/Gemma-The-Writer-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DavidAU/Gemma-The-Writer-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavidAU/Gemma-The-Writer-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DavidAU/Gemma-The-Writer-9B
- SGLang
How to use DavidAU/Gemma-The-Writer-9B 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 "DavidAU/Gemma-The-Writer-9B" \ --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": "DavidAU/Gemma-The-Writer-9B", "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 "DavidAU/Gemma-The-Writer-9B" \ --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": "DavidAU/Gemma-The-Writer-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DavidAU/Gemma-The-Writer-9B with Docker Model Runner:
docker model run hf.co/DavidAU/Gemma-The-Writer-9B
Upload folder using huggingface_hub
Browse files- model-00010-of-00019.safetensors +3 -0
- model-00011-of-00019.safetensors +3 -0
- model-00012-of-00019.safetensors +3 -0
- model-00013-of-00019.safetensors +3 -0
- model-00014-of-00019.safetensors +3 -0
- model-00015-of-00019.safetensors +3 -0
- model-00016-of-00019.safetensors +3 -0
- model-00017-of-00019.safetensors +3 -0
- model-00018-of-00019.safetensors +3 -0
- model-00019-of-00019.safetensors +3 -0
model-00010-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bad19126de098c1a4816615d6c0c2fdbdb6b26139a970a405577f981124642a1
|
| 3 |
+
size 983653936
|
model-00011-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33c98b2f7dbc048761e8adcfecdf7b768e8e634e23630746a17346b6d7547a6e
|
| 3 |
+
size 998304504
|
model-00012-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18a92bb1878c9ca7ff632ae3db3cae3180194d9e3bf4e5ac2044eddfecc9ba8d
|
| 3 |
+
size 983653920
|
model-00013-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:189c4491ddcd276244e9cf681e1ace0b5af1920bb63d204f9d8ed9960d2e400a
|
| 3 |
+
size 998304504
|
model-00014-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:529724e0320170e0831aada1f57faba71350e7bb5a89da4d606cb1e0fd6f93c5
|
| 3 |
+
size 983653936
|
model-00015-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c2f046c362f76ed76aa39d15471bdf6a342ca2a10f9d11ee89d28bd84c0aa50
|
| 3 |
+
size 998304504
|
model-00016-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93176b32f9a2ca8c56d441040b24201ff7c1d38f89488d7ebb4ed6b23378d638
|
| 3 |
+
size 983653920
|
model-00017-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6db47c65c1998ab766814443ff567d3a1f2e7752f75bfb23a5b3b919fb95f0ba
|
| 3 |
+
size 998304504
|
model-00018-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cae24876ebd2c8fc5140734a77fb1d498fdc4b6e5bc225d770c552138ee81729
|
| 3 |
+
size 983653904
|
model-00019-of-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:edd2a1aff95447894a0cff5486c62f245a99fdabd67ff34820289b018570b04c
|
| 3 |
+
size 792783344
|