Text Generation
Transformers
Safetensors
PyTorch
English
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use mattshumer/Meta-Llama-3-8B-Instruct-LongTest with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mattshumer/Meta-Llama-3-8B-Instruct-LongTest with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mattshumer/Meta-Llama-3-8B-Instruct-LongTest") 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("mattshumer/Meta-Llama-3-8B-Instruct-LongTest") model = AutoModelForCausalLM.from_pretrained("mattshumer/Meta-Llama-3-8B-Instruct-LongTest", 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 mattshumer/Meta-Llama-3-8B-Instruct-LongTest with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mattshumer/Meta-Llama-3-8B-Instruct-LongTest" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mattshumer/Meta-Llama-3-8B-Instruct-LongTest", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mattshumer/Meta-Llama-3-8B-Instruct-LongTest
- SGLang
How to use mattshumer/Meta-Llama-3-8B-Instruct-LongTest 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 "mattshumer/Meta-Llama-3-8B-Instruct-LongTest" \ --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": "mattshumer/Meta-Llama-3-8B-Instruct-LongTest", "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 "mattshumer/Meta-Llama-3-8B-Instruct-LongTest" \ --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": "mattshumer/Meta-Llama-3-8B-Instruct-LongTest", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mattshumer/Meta-Llama-3-8B-Instruct-LongTest with Docker Model Runner:
docker model run hf.co/mattshumer/Meta-Llama-3-8B-Instruct-LongTest
Commit History
-
Update config.json
Verified signaturebf96966 -
Upload folder using huggingface_hub (#1)
Verified signature- 0c7f662fec3379a4561318a75996879195f9a3c8f9305fa63d6fc7ff584070ea (b529bae58141bb3ef72a6ae9833fecab93b9d15c) - 6645512346413a2f1c93781f0aa8b3a6b9a7a8a2cb893ecdbc3893e5e0086687 (43db39cf0c1b4db75314a828ccd9e22bf36c10f5) - 65d76685fc96df1797fdc1404fbc557c89fa5920b79dc0ea8360203a8bfa66c4 (4b35ee0ddafc69bfaba4d1b88d3c5bc5bd145d73) - c73ddca00369f87dffa43dde37426d2a73a581b7202f110587fa33e624c668cb (952a30d8f7f7c8e04f24e0d00a60aa81a8502f0b) - fad85d39456eb03210291de8a4ae43ec0262050e87878c33fb754f18ce63eca8 (973e1867dbffeaf0b4702085e11a0268217d39d5)3d60861 -
initial commit
Verified signature55481d3