Instructions to use jtglover/demo-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jtglover/demo-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jtglover/demo-model") 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("jtglover/demo-model") model = AutoModelForCausalLM.from_pretrained("jtglover/demo-model", 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 jtglover/demo-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jtglover/demo-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jtglover/demo-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jtglover/demo-model
- SGLang
How to use jtglover/demo-model 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 "jtglover/demo-model" \ --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": "jtglover/demo-model", "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 "jtglover/demo-model" \ --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": "jtglover/demo-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jtglover/demo-model with Docker Model Runner:
docker model run hf.co/jtglover/demo-model
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- 87d17044d0369167ff32cdb493c7130ceb325aa58cf4231ad3760d2a491c3eb7 (6d7cf0e4a127bf150363a6c453999e9b53384531) - c90ad8c98fb5812bdfd5d4290c6a63857426fd3be782435607ebf790d95103f4 (b51abec5a29c69439c2ca0297f116510b4ff2b14) - faf426e3a7922d9416b490244757824bd1a11c66f0690d5ba205aed835b6a0a4 (34e9dfa0253dc36d55e2f5890e91431c84f38306) - fdba34af200b4bc94445552651cab866ffa954d5fc423848b4ca3c2c017ee37e (c2ae72fb7e113acb59687a71db8e21488ec92dd3)0591280 -
initial commit
Verified signatureed5af09