Instructions to use BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B") 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("BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B") model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B
- SGLang
How to use BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B 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 "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B" \ --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": "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B", "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 "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B" \ --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": "BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B with Docker Model Runner:
docker model run hf.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B
Download md5 from BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B: direct link, hf CLI and curl.
- Browser
- Download file 2.34 kB
-
https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B/resolve/main/md5
- Command line
-
hf download hf://BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B/md5
-
curl -L -o md5 https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B/resolve/main/md5
2.34 kB
| 26c9bc2b53c372a4207dac1fc6cc75fb config.json | |
| efead4b67f76b346233b74441c632ad2 generation_config.json | |
| d66f0a65074956b11b7473841c103486 model-00001-of-00030.safetensors | |
| 02aa530739267298af5f2c95a7c5b68a model-00002-of-00030.safetensors | |
| 5fefc9e07f6f99c1ceb6b009c9ff977d model-00003-of-00030.safetensors | |
| fd7835491adffccd2ae79baa92acfdb8 model-00004-of-00030.safetensors | |
| 6c6473a77ed7fb3a129733b3296c9557 model-00005-of-00030.safetensors | |
| 27084a34fbb437c2f9ee1d230c891b18 model-00006-of-00030.safetensors | |
| 59b64f5ce31feac8c99d7e90b38e0501 model-00007-of-00030.safetensors | |
| d58849c663dba619d99b9b591352b9e2 model-00008-of-00030.safetensors | |
| dc061ee0404464b35d12d410b029a2f7 model-00009-of-00030.safetensors | |
| b0b15a614d93e7d0feb8eb388555d47d model-00010-of-00030.safetensors | |
| 4adf7a44963b490094445aea26f22950 model-00011-of-00030.safetensors | |
| d158d7f8e2372b1d269ecf6ea4c7f3c1 model-00012-of-00030.safetensors | |
| c3e0360f9909a8b65e1c3e454da08de7 model-00013-of-00030.safetensors | |
| 39a91bbabfba307d2554f72793b09549 model-00014-of-00030.safetensors | |
| e4dd3eebb5b427528f8e07cc3cafa4e5 model-00015-of-00030.safetensors | |
| 48d5023323fd03a2b219d5d10c3024bb model-00016-of-00030.safetensors | |
| c19b05cbb4c4430299a63f15c9fe2a90 model-00017-of-00030.safetensors | |
| cb5305b580c9001f4e5f7cab1d0b9df2 model-00018-of-00030.safetensors | |
| 7a8e1c5749631de79fc10c0565e26b1d model-00019-of-00030.safetensors | |
| 9bd7cc81086d5849ee0700731f60d57d model-00020-of-00030.safetensors | |
| d4ffd2d8057f836555ef7b9d7fa3bec8 model-00021-of-00030.safetensors | |
| 2c7848ab4ada988f0819e8c4d31d06c6 model-00022-of-00030.safetensors | |
| 9bf1eff52eadb257adc09cdb486e711a model-00023-of-00030.safetensors | |
| 880ade2735ff6af6144793b03e184f6d model-00024-of-00030.safetensors | |
| 5db9a52281154e39a67348887eecb474 model-00025-of-00030.safetensors | |
| 0a6d981ef1b9a1d787b2f93132afa155 model-00026-of-00030.safetensors | |
| 044ef5531ec99b09ffdffebd92c0cb5c model-00027-of-00030.safetensors | |
| 269433e49df720987d70b34b166eb405 model-00028-of-00030.safetensors | |
| 08c4cdecff146adbb9a854bfb7449f3e model-00029-of-00030.safetensors | |
| ba38bccd726f5cca07fff68463663f75 model-00030-of-00030.safetensors | |
| 619befe5bfadf56a2f8b435bc3b27fbe model.safetensors.index.json | |
| 33451ef46cbf550462128da373a66286 special_tokens_map.json | |
| ffcc9f7b5ef2191d144802baa72b1d3a tokenizer.json | |
| 8443e5855270a6ac6a4516e940f10817 tokenizer_config.json | |