Text Generation
Transformers
Safetensors
mistral
mergekit
Merge
conversational
text-generation-inference
Instructions to use atisharma/narratrix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use atisharma/narratrix with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="atisharma/narratrix") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("atisharma/narratrix") model = AutoModelForCausalLM.from_pretrained("atisharma/narratrix", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use atisharma/narratrix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "atisharma/narratrix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "atisharma/narratrix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/atisharma/narratrix
- SGLang
How to use atisharma/narratrix 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 "atisharma/narratrix" \ --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": "atisharma/narratrix", "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 "atisharma/narratrix" \ --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": "atisharma/narratrix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use atisharma/narratrix with Docker Model Runner:
docker model run hf.co/atisharma/narratrix
Download hooks/pre-push.sample from atisharma/narratrix: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/atisharma/narratrix/resolve/main/hooks/pre-push.sample
- Command line
-
hf download hf://atisharma/narratrix/hooks/pre-push.sample
-
curl -L -o pre-push.sample https://huggingface.co/atisharma/narratrix/resolve/main/hooks/pre-push.sample
1.37 kB
| # An example hook script to verify what is about to be pushed. Called by "git | |
| # push" after it has checked the remote status, but before anything has been | |
| # pushed. If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # This hook is called with the following parameters: | |
| # | |
| # $1 -- Name of the remote to which the push is being done | |
| # $2 -- URL to which the push is being done | |
| # | |
| # If pushing without using a named remote those arguments will be equal. | |
| # | |
| # Information about the commits which are being pushed is supplied as lines to | |
| # the standard input in the form: | |
| # | |
| # <local ref> <local oid> <remote ref> <remote oid> | |
| # | |
| # This sample shows how to prevent push of commits where the log message starts | |
| # with "WIP" (work in progress). | |
| remote="$1" | |
| url="$2" | |
| zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0') | |
| while read local_ref local_oid remote_ref remote_oid | |
| do | |
| if test "$local_oid" = "$zero" | |
| then | |
| # Handle delete | |
| : | |
| else | |
| if test "$remote_oid" = "$zero" | |
| then | |
| # New branch, examine all commits | |
| range="$local_oid" | |
| else | |
| # Update to existing branch, examine new commits | |
| range="$remote_oid..$local_oid" | |
| fi | |
| # Check for WIP commit | |
| commit=$(git rev-list -n 1 --grep '^WIP' "$range") | |
| if test -n "$commit" | |
| then | |
| echo >&2 "Found WIP commit in $local_ref, not pushing" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| exit 0 | |