Instructions to use KoboldAI/OPT-6B-nerys-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KoboldAI/OPT-6B-nerys-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KoboldAI/OPT-6B-nerys-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KoboldAI/OPT-6B-nerys-v2") model = AutoModelForCausalLM.from_pretrained("KoboldAI/OPT-6B-nerys-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KoboldAI/OPT-6B-nerys-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KoboldAI/OPT-6B-nerys-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KoboldAI/OPT-6B-nerys-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KoboldAI/OPT-6B-nerys-v2
- SGLang
How to use KoboldAI/OPT-6B-nerys-v2 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 "KoboldAI/OPT-6B-nerys-v2" \ --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": "KoboldAI/OPT-6B-nerys-v2", "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 "KoboldAI/OPT-6B-nerys-v2" \ --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": "KoboldAI/OPT-6B-nerys-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KoboldAI/OPT-6B-nerys-v2 with Docker Model Runner:
docker model run hf.co/KoboldAI/OPT-6B-nerys-v2
| { | |
| "_name_or_path": "facebook/opt-6.7b", | |
| "_remove_final_layer_norm": false, | |
| "activation_dropout": 0.0, | |
| "activation_function": "relu", | |
| "architectures": [ | |
| "OPTForCausalLM" | |
| ], | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 2, | |
| "do_layer_norm_before": true, | |
| "dropout": 0.1, | |
| "eos_token_id": 2, | |
| "ffn_dim": 16384, | |
| "hidden_size": 4096, | |
| "init_std": 0.02, | |
| "layerdrop": 0.0, | |
| "max_position_embeddings": 2048, | |
| "model_type": "opt", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 32, | |
| "pad_token_id": 1, | |
| "prefix": "</s>", | |
| "torch_dtype": "float16", | |
| "transformers_version": "4.21.0.dev0", | |
| "use_cache": false, | |
| "vocab_size": 50265, | |
| "word_embed_proj_dim": 4096, | |
| "welcome": "You are currently running the hybrid novel/adventure-writing model `Nerys v2, OPT-6B edition.`\n\n This model is made by [Mr. Seeker](https://www.patreon.com/mrseeker)\n\n### How to use this model\n\nNerys can both generate adventures and stories. Use the authors note to give it a certain genre to follow, use memory to give an overview of the story and use World Information to give it specific details about the characters. To start off, give the AI an idea of what you are writing about by setting the scene. Give the AI around 10 sentences that make your story really interesting to read. Introduce your character, describe the world, blow something up, or let the AI use its creative mind. Turn Adventure mode on for an AI-Dungeon experience.", | |
| "antemplate": "[Genre: <|>]" | |
| } | |