Add Mixtral-8x7B-Instruct-v0.1-int8-ov
Browse files- .gitattributes +1 -0
- README.md +67 -0
- config.json +31 -0
- openvino_model.bin +3 -0
- openvino_model.xml +3 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +42 -0
    	
        .gitattributes
    CHANGED
    
    | @@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text | |
| 33 | 
             
            *.zip filter=lfs diff=lfs merge=lfs -text
         | 
| 34 | 
             
            *.zst filter=lfs diff=lfs merge=lfs -text
         | 
| 35 | 
             
            *tfevents* filter=lfs diff=lfs merge=lfs -text
         | 
|  | 
|  | |
| 33 | 
             
            *.zip filter=lfs diff=lfs merge=lfs -text
         | 
| 34 | 
             
            *.zst filter=lfs diff=lfs merge=lfs -text
         | 
| 35 | 
             
            *tfevents* filter=lfs diff=lfs merge=lfs -text
         | 
| 36 | 
            +
            *.xml filter=lfs diff=lfs merge=lfs -text
         | 
    	
        README.md
    CHANGED
    
    | @@ -1,3 +1,70 @@ | |
| 1 | 
             
            ---
         | 
| 2 | 
             
            license: apache-2.0
         | 
|  | |
|  | |
| 3 | 
             
            ---
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
             
            ---
         | 
| 2 | 
             
            license: apache-2.0
         | 
| 3 | 
            +
            language:
         | 
| 4 | 
            +
            - en
         | 
| 5 | 
             
            ---
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            # Mixtral-8x7b-Instruct-v0.1-int8-ov
         | 
| 8 | 
            +
             | 
| 9 | 
            +
             * Model creator: [Mistral AI](https://huggingface.co/mistralai)
         | 
| 10 | 
            +
             * Original model: [Mixtral 8X7B Instruct v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1)
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            ## Description
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            This is [Mixtral-8x7b-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) model converted to the [OpenVINO™ IR](https://docs.openvino.ai/2024/documentation/openvino-ir-format.html) (Intermediate Representation) format with weights compressed to INT8 by [NNCF](https://github.com/openvinotoolkit/nncf).
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            ## Quantization Parameters
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            Weight compression was performed using `nncf.compress_weights` with the following parameters:
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            * mode: **INT8_ASYM**
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            For more information on quantization, check the [OpenVINO model optimization guide](https://docs.openvino.ai/2024/openvino-workflow/model-optimization-guide/weight-compression.html).
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            ## Compatibility
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            The provided OpenVINO™ IR model is compatible with:
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            * OpenVINO version 2024.0.0 and higher
         | 
| 29 | 
            +
            * Optimum Intel 1.16.0 and higher
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            ## Running Model Inference
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            ```
         | 
| 36 | 
            +
            pip install optimum[openvino]
         | 
| 37 | 
            +
            ```
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            2. Run model inference:
         | 
| 40 | 
            +
             | 
| 41 | 
            +
            ```
         | 
| 42 | 
            +
            from transformers import AutoTokenizer
         | 
| 43 | 
            +
            from optimum.intel.openvino import OVModelForCausalLM
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            model_id = "OpenVINO/mixtral-8x7b-instruct-v0.1-int8-ov"
         | 
| 46 | 
            +
            tokenizer = AutoTokenizer.from_pretrained(model_id)
         | 
| 47 | 
            +
            model = OVModelForCausalLM.from_pretrained(model_id)
         | 
| 48 | 
            +
             | 
| 49 | 
            +
             | 
| 50 | 
            +
            messages = [
         | 
| 51 | 
            +
                {"role": "user", "content": "What is your favourite condiment?"},
         | 
| 52 | 
            +
                {"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
         | 
| 53 | 
            +
                {"role": "user", "content": "Do you have mayonnaise recipes?"}
         | 
| 54 | 
            +
            ]
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            outputs = model.generate(inputs, max_new_tokens=20)
         | 
| 59 | 
            +
            print(tokenizer.decode(outputs[0], skip_special_tokens=True))
         | 
| 60 | 
            +
            ```
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            For more examples and possible optimizations, refer to the [OpenVINO Large Language Model Inference Guide](https://docs.openvino.ai/2024/learn-openvino/llm_inference_guide.html).
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            ## Limitations
         | 
| 65 | 
            +
             | 
| 66 | 
            +
            Check the original model card for [limitations](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#limitations).
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            ## Legal information
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            The original model is distributed under [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) license. More details can be found in [original model card](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1).
         | 
    	
        config.json
    ADDED
    
    | @@ -0,0 +1,31 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "_name_or_path": "/nfs/ov-share-05/data/cv_bench_cache/DL_benchmarking_models/mixtral-8x7b-v0.1/pytorch",
         | 
| 3 | 
            +
              "architectures": [
         | 
| 4 | 
            +
                "MixtralForCausalLM"
         | 
| 5 | 
            +
              ],
         | 
| 6 | 
            +
              "attention_dropout": 0.0,
         | 
| 7 | 
            +
              "bos_token_id": 1,
         | 
| 8 | 
            +
              "eos_token_id": 2,
         | 
| 9 | 
            +
              "hidden_act": "silu",
         | 
| 10 | 
            +
              "hidden_size": 4096,
         | 
| 11 | 
            +
              "initializer_range": 0.02,
         | 
| 12 | 
            +
              "intermediate_size": 14336,
         | 
| 13 | 
            +
              "max_position_embeddings": 32768,
         | 
| 14 | 
            +
              "model_type": "mixtral",
         | 
| 15 | 
            +
              "num_attention_heads": 32,
         | 
| 16 | 
            +
              "num_experts_per_tok": 2,
         | 
| 17 | 
            +
              "num_hidden_layers": 32,
         | 
| 18 | 
            +
              "num_key_value_heads": 8,
         | 
| 19 | 
            +
              "num_local_experts": 8,
         | 
| 20 | 
            +
              "output_router_logits": false,
         | 
| 21 | 
            +
              "rms_norm_eps": 1e-05,
         | 
| 22 | 
            +
              "rope_theta": 1000000.0,
         | 
| 23 | 
            +
              "router_aux_loss_coef": 0.02,
         | 
| 24 | 
            +
              "router_jitter_noise": 0.0,
         | 
| 25 | 
            +
              "sliding_window": null,
         | 
| 26 | 
            +
              "tie_word_embeddings": false,
         | 
| 27 | 
            +
              "torch_dtype": "bfloat16",
         | 
| 28 | 
            +
              "transformers_version": "4.40.1",
         | 
| 29 | 
            +
              "use_cache": true,
         | 
| 30 | 
            +
              "vocab_size": 32000
         | 
| 31 | 
            +
            }
         | 
    	
        openvino_model.bin
    ADDED
    
    | @@ -0,0 +1,3 @@ | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            version https://git-lfs.github.com/spec/v1
         | 
| 2 | 
            +
            oid sha256:44d87b757ba78b58bccc61f8447cd507ed831332d422e1717eb364af75131942
         | 
| 3 | 
            +
            size 46746178118
         | 
    	
        openvino_model.xml
    ADDED
    
    | @@ -0,0 +1,3 @@ | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            version https://git-lfs.github.com/spec/v1
         | 
| 2 | 
            +
            oid sha256:2dc688840e95dcc30ecd28f3f4ba7e970fc3dee8db3d0a58fda1f9e5b676b429
         | 
| 3 | 
            +
            size 12861218
         | 
    	
        special_tokens_map.json
    ADDED
    
    | @@ -0,0 +1,23 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "bos_token": {
         | 
| 3 | 
            +
                "content": "<s>",
         | 
| 4 | 
            +
                "lstrip": false,
         | 
| 5 | 
            +
                "normalized": false,
         | 
| 6 | 
            +
                "rstrip": false,
         | 
| 7 | 
            +
                "single_word": false
         | 
| 8 | 
            +
              },
         | 
| 9 | 
            +
              "eos_token": {
         | 
| 10 | 
            +
                "content": "</s>",
         | 
| 11 | 
            +
                "lstrip": false,
         | 
| 12 | 
            +
                "normalized": false,
         | 
| 13 | 
            +
                "rstrip": false,
         | 
| 14 | 
            +
                "single_word": false
         | 
| 15 | 
            +
              },
         | 
| 16 | 
            +
              "unk_token": {
         | 
| 17 | 
            +
                "content": "<unk>",
         | 
| 18 | 
            +
                "lstrip": false,
         | 
| 19 | 
            +
                "normalized": false,
         | 
| 20 | 
            +
                "rstrip": false,
         | 
| 21 | 
            +
                "single_word": false
         | 
| 22 | 
            +
              }
         | 
| 23 | 
            +
            }
         | 
    	
        tokenizer.json
    ADDED
    
    | The diff for this file is too large to render. 
		See raw diff | 
|  | 
    	
        tokenizer.model
    ADDED
    
    | @@ -0,0 +1,3 @@ | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            version https://git-lfs.github.com/spec/v1
         | 
| 2 | 
            +
            oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
         | 
| 3 | 
            +
            size 493443
         | 
    	
        tokenizer_config.json
    ADDED
    
    | @@ -0,0 +1,42 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "add_bos_token": true,
         | 
| 3 | 
            +
              "add_eos_token": false,
         | 
| 4 | 
            +
              "added_tokens_decoder": {
         | 
| 5 | 
            +
                "0": {
         | 
| 6 | 
            +
                  "content": "<unk>",
         | 
| 7 | 
            +
                  "lstrip": false,
         | 
| 8 | 
            +
                  "normalized": false,
         | 
| 9 | 
            +
                  "rstrip": false,
         | 
| 10 | 
            +
                  "single_word": false,
         | 
| 11 | 
            +
                  "special": true
         | 
| 12 | 
            +
                },
         | 
| 13 | 
            +
                "1": {
         | 
| 14 | 
            +
                  "content": "<s>",
         | 
| 15 | 
            +
                  "lstrip": false,
         | 
| 16 | 
            +
                  "normalized": false,
         | 
| 17 | 
            +
                  "rstrip": false,
         | 
| 18 | 
            +
                  "single_word": false,
         | 
| 19 | 
            +
                  "special": true
         | 
| 20 | 
            +
                },
         | 
| 21 | 
            +
                "2": {
         | 
| 22 | 
            +
                  "content": "</s>",
         | 
| 23 | 
            +
                  "lstrip": false,
         | 
| 24 | 
            +
                  "normalized": false,
         | 
| 25 | 
            +
                  "rstrip": false,
         | 
| 26 | 
            +
                  "single_word": false,
         | 
| 27 | 
            +
                  "special": true
         | 
| 28 | 
            +
                }
         | 
| 29 | 
            +
              },
         | 
| 30 | 
            +
              "additional_special_tokens": [],
         | 
| 31 | 
            +
              "bos_token": "<s>",
         | 
| 32 | 
            +
              "clean_up_tokenization_spaces": false,
         | 
| 33 | 
            +
              "eos_token": "</s>",
         | 
| 34 | 
            +
              "legacy": true,
         | 
| 35 | 
            +
              "model_max_length": 1000000000000000019884624838656,
         | 
| 36 | 
            +
              "pad_token": null,
         | 
| 37 | 
            +
              "sp_model_kwargs": {},
         | 
| 38 | 
            +
              "spaces_between_special_tokens": false,
         | 
| 39 | 
            +
              "tokenizer_class": "LlamaTokenizer",
         | 
| 40 | 
            +
              "unk_token": "<unk>",
         | 
| 41 | 
            +
              "use_default_system_prompt": false
         | 
| 42 | 
            +
            }
         | 
