Text Generation
Transformers
Safetensors
English
gpt_neox
roleplay
victorian
text-generation-inference
Instructions to use zakarth/violet-1b4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zakarth/violet-1b4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zakarth/violet-1b4")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zakarth/violet-1b4") model = AutoModelForCausalLM.from_pretrained("zakarth/violet-1b4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zakarth/violet-1b4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zakarth/violet-1b4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zakarth/violet-1b4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zakarth/violet-1b4
- SGLang
How to use zakarth/violet-1b4 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 "zakarth/violet-1b4" \ --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": "zakarth/violet-1b4", "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 "zakarth/violet-1b4" \ --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": "zakarth/violet-1b4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zakarth/violet-1b4 with Docker Model Runner:
docker model run hf.co/zakarth/violet-1b4
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -48,7 +48,7 @@ Violet was built on a corpus spanning 1800–1899 sourced from Project Gutenberg
|
|
| 48 |
This project began as an attempt to build a local LLM without relying on copyrighted training sources. The author also values local models that can run on a user’s machine without sending data to the cloud.
|
| 49 |
|
| 50 |
## Demo Resources
|
| 51 |
-
- HF Space: [Transformers.js Demo](
|
| 52 |
- CloudFlare Mirror: [Transformers.js Demo](https://pub-353f427e6227415cb077f3645638c125.r2.dev/index.html)
|
| 53 |
- Both of these are intended to use WebGPU and run local on your system -- No data is sent to the cloud.
|
| 54 |
|
|
@@ -87,7 +87,7 @@ Special tokens used during training (typical IDs from training config):
|
|
| 87 |
|
| 88 |
!! Do not mix tokenizers from other Violet variants (e.g. 160M) with this model.
|
| 89 |
|
| 90 |
-
## How to use (Transformers)
|
| 91 |
```code
|
| 92 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 93 |
import torch
|
|
|
|
| 48 |
This project began as an attempt to build a local LLM without relying on copyrighted training sources. The author also values local models that can run on a user’s machine without sending data to the cloud.
|
| 49 |
|
| 50 |
## Demo Resources
|
| 51 |
+
- HF Space: [Transformers.js Demo](/spaces/zakarth/violetdemo)
|
| 52 |
- CloudFlare Mirror: [Transformers.js Demo](https://pub-353f427e6227415cb077f3645638c125.r2.dev/index.html)
|
| 53 |
- Both of these are intended to use WebGPU and run local on your system -- No data is sent to the cloud.
|
| 54 |
|
|
|
|
| 87 |
|
| 88 |
!! Do not mix tokenizers from other Violet variants (e.g. 160M) with this model.
|
| 89 |
|
| 90 |
+
## How to use (Transformers.js)
|
| 91 |
```code
|
| 92 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 93 |
import torch
|