Text Generation
Transformers
Safetensors
OpenVINO
English
Chinese
llama
nncf
4-bit precision
conversational
text-generation-inference
Instructions to use AIFunOver/OpenCoder-8B-Instruct-openvino-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AIFunOver/OpenCoder-8B-Instruct-openvino-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AIFunOver/OpenCoder-8B-Instruct-openvino-4bit") 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("AIFunOver/OpenCoder-8B-Instruct-openvino-4bit") model = AutoModelForCausalLM.from_pretrained("AIFunOver/OpenCoder-8B-Instruct-openvino-4bit", 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 AIFunOver/OpenCoder-8B-Instruct-openvino-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AIFunOver/OpenCoder-8B-Instruct-openvino-4bit
- SGLang
How to use AIFunOver/OpenCoder-8B-Instruct-openvino-4bit 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 "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit" \ --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": "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit", "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 "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit" \ --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": "AIFunOver/OpenCoder-8B-Instruct-openvino-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AIFunOver/OpenCoder-8B-Instruct-openvino-4bit with Docker Model Runner:
docker model run hf.co/AIFunOver/OpenCoder-8B-Instruct-openvino-4bit
Upload tokenizer_config.json with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394{ "add_prefix_space": false, "added_tokens_decoder": { "0": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "3": { "content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96499": { "content": "<|start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96500": { "content": "<|end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96501": { "content": "<|message|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96502": { "content": "<|tool_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96503": { "content": "<|tool_excute|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96504": { "content": "<|tool_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96505": { "content": "<|pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96506": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96507": { "content": "<fim_prefix>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96508": { "content": "<fim_middle>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96509": { "content": "<fim_suffix>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96510": { "content": "<repo_name>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96511": { "content": "<file_sep>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96512": { "content": "<issue_start>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96513": { "content": "<issue_comment>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96514": { "content": "<issue_closed>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96515": { "content": "<jupyter_start>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96516": { "content": "<jupyter_text>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96517": { "content": "<jupyter_code>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96518": { "content": "<jupyter_output>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96519": { "content": "<jupyter_script>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96520": { "content": "<empty_output>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96521": { "content": "<code_to_intermediate>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96522": { "content": "<intermediate_to_code>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96523": { "content": "<pr>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96524": { "content": "<pr_status>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96525": { "content": "<pr_is_merged>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96526": { "content": "<pr_base>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96527": { "content": "<pr_file>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96528": { "content": "<pr_base_code>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96529": { "content": "<pr_diff>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96530": { "content": "<pr_diff_hunk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96531": { "content": "<pr_comment>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96532": { "content": "<pr_event_id>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96533": { "content": "<pr_review>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96534": { "content": "<pr_review_state>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96535": { "content": "<pr_review_comment>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96536": { "content": "<pr_in_reply_to_review_id>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96537": { "content": "<pr_in_reply_to_comment_id>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96538": { "content": "<pr_diff_hunk_comment_line>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96539": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "96540": { "content": "<|im_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "<|im_end|>", "<|im_start|>" ], "auto_map": { "AutoTokenizer": [ "tokenization_inflm.INFLMTokenizer", null ] }, "bos_token": "<|im_start|>", "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are OpenCoder, created by OpenCoder Team.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}", "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "model_max_length": 1300, "pad_token": "<pad>", "padding_side": "right", "return_tensors": true, "spaces_between_special_tokens": false, "tokenizer_class": "INFLMTokenizer", "unk_token": "<unk>"}tokenizer_config.jsonAdded+394