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/prepare-commit-msg.sample from atisharma/narratrix: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/atisharma/narratrix/resolve/main/hooks/prepare-commit-msg.sample
- Command line
-
hf download hf://atisharma/narratrix/hooks/prepare-commit-msg.sample
-
curl -L -o prepare-commit-msg.sample https://huggingface.co/atisharma/narratrix/resolve/main/hooks/prepare-commit-msg.sample
1.49 kB
| # | |
| # An example hook script to prepare the commit log message. | |
| # Called by "git commit" with the name of the file that has the | |
| # commit message, followed by the description of the commit | |
| # message's source. The hook's purpose is to edit the commit | |
| # message file. If the hook fails with a non-zero status, | |
| # the commit is aborted. | |
| # | |
| # To enable this hook, rename this file to "prepare-commit-msg". | |
| # This hook includes three examples. The first one removes the | |
| # "# Please enter the commit message..." help message. | |
| # | |
| # The second includes the output of "git diff --name-status -r" | |
| # into the message, just before the "git status" output. It is | |
| # commented because it doesn't cope with --amend or with squashed | |
| # commits. | |
| # | |
| # The third example adds a Signed-off-by line to the message, that can | |
| # still be edited. This is rarely a good idea. | |
| COMMIT_MSG_FILE=$1 | |
| COMMIT_SOURCE=$2 | |
| SHA1=$3 | |
| /usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" | |
| # case "$COMMIT_SOURCE,$SHA1" in | |
| # ,|template,) | |
| # /usr/bin/perl -i.bak -pe ' | |
| # print "\n" . `git diff --cached --name-status -r` | |
| # if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; | |
| # *) ;; | |
| # esac | |
| # SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') | |
| # git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" | |
| # if test -z "$COMMIT_SOURCE" | |
| # then | |
| # /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" | |
| # fi | |