Instructions to use MILVLG/imp-v1-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MILVLG/imp-v1-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MILVLG/imp-v1-3b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("MILVLG/imp-v1-3b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MILVLG/imp-v1-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MILVLG/imp-v1-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MILVLG/imp-v1-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MILVLG/imp-v1-3b
- SGLang
How to use MILVLG/imp-v1-3b 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 "MILVLG/imp-v1-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MILVLG/imp-v1-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "MILVLG/imp-v1-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MILVLG/imp-v1-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MILVLG/imp-v1-3b with Docker Model Runner:
docker model run hf.co/MILVLG/imp-v1-3b
eos_token_id discrepency
Hello, I don't know if this was intended, but model.generation_config.eos_token_id != tokenizer.eos_token_id. This discrepency can create a problem when training the model while adding the tokenizer's eos token and expecting the generation to stop with a different token.
Hi, thanks for your interest to imp. In our tests, model.generation_config.eos_token_idand tokenizer.eos_token_id are using the same token id </s>.
And can you tell me the version of your tokneizer package, this could be help for finding the problem.
No thank you you, it works great for me, and still even Nvidia cannot beat you https://twitter.com/Jacoed/status/1770795726877990953.
tok.eos_token_id
50256
llm.generation_config.eos_token_id
50295
from transformers import ViltProcessor, AutoModel, AutoModelForCausalLM, AutoTokenizer
import transformers
transformers.version
'4.39.0'
The tokenizer comes from transformers for me, does that answer your question @Oyoy1235 ?
Great, I think we don't have other questions in eos_token_id.