Instructions to use jtglover/my-new-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jtglover/my-new-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jtglover/my-new-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/my-new-model") model = AutoModelForCausalLM.from_pretrained("jtglover/my-new-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/my-new-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jtglover/my-new-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/my-new-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jtglover/my-new-model
- SGLang
How to use jtglover/my-new-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/my-new-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/my-new-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/my-new-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/my-new-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jtglover/my-new-model with Docker Model Runner:
docker model run hf.co/jtglover/my-new-model
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- b6d4f42925c54a6ec8d7ec1d2142d8bef472d4c7fb3f8bfbf89c7c664e4791f5 (ad6399a0adc0f32b46d555789f60591422aba498) - 76878bb87ce7bc9026e20785024e4841ee4866d9a04851db83e2e9d551199612 (5e05b3b17d9bba2f5f53b7de9146628236c626ae) - d89e2554d42cbc67b9ae1e4b71a07c90949c3f7f842b842a87edeb0fd09ce985 (95bb3fe64307174a8e135e1ae5851c0f2625b730) - fdba34af200b4bc94445552651cab866ffa954d5fc423848b4ca3c2c017ee37e (234029b5c6388d393f570479aaff18e845e56fa4)6ba0b78