add mixtral-8x7b
Browse files- README.md +48 -0
 - config.json +30 -0
 - openvino_model.bin +3 -0
 - openvino_model.xml +0 -0
 - special_tokens_map.json +23 -0
 - tokenizer.json +0 -0
 - tokenizer.model +3 -0
 - tokenizer_config.json +42 -0
 
    	
        README.md
    ADDED
    
    | 
         @@ -0,0 +1,48 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            # Mixtral-8x7b-Instruct-v0.1-int4-ov
         
     | 
| 2 | 
         
            +
             * Model creator: [Mistral AI](https://huggingface.co/mistralai)
         
     | 
| 3 | 
         
            +
             * Original model: [Mixtral 8X7B Instruct v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1)
         
     | 
| 4 | 
         
            +
             
     | 
| 5 | 
         
            +
            ## Description
         
     | 
| 6 | 
         
            +
            This is [Mixtral-8x7b-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) model converted to [OpenVINO](https://docs.openvino.ai/2024/home.html) Intermediate Representation (IR) format with INT4 compressed weights using [NNCF](https://github.com/openvinotoolkit/nncf).
         
     | 
| 7 | 
         
            +
             
     | 
| 8 | 
         
            +
            ## Compatibility
         
     | 
| 9 | 
         
            +
             
     | 
| 10 | 
         
            +
            This provided IR is compatible with openvino starting with 2024.0.0 version and optimum-intel 1.16.0
         
     | 
| 11 | 
         
            +
             
     | 
| 12 | 
         
            +
            ## Usage
         
     | 
| 13 | 
         
            +
             
     | 
| 14 | 
         
            +
            ### Install required packages
         
     | 
| 15 | 
         
            +
             
     | 
| 16 | 
         
            +
            To install the required components for using [Optimum Intel integration](https://huggingface.co/docs/optimum/intel/index) with the OpenVINO backend, do: 
         
     | 
| 17 | 
         
            +
            ```
         
     | 
| 18 | 
         
            +
            pip install optimum[openvino]
         
     | 
| 19 | 
         
            +
            ```
         
     | 
| 20 | 
         
            +
             
     | 
| 21 | 
         
            +
            ### Run model inference
         
     | 
| 22 | 
         
            +
            ```
         
     | 
| 23 | 
         
            +
            from transformers import AutoTokenizer
         
     | 
| 24 | 
         
            +
            from optimum.intel.openvino import OVModelForCausalLM
         
     | 
| 25 | 
         
            +
             
     | 
| 26 | 
         
            +
            model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
         
     | 
| 27 | 
         
            +
            tokenizer = AutoTokenizer.from_pretrained(model_id)
         
     | 
| 28 | 
         
            +
            model = OVModelForCausalLM.from_pretrained(model_id)
         
     | 
| 29 | 
         
            +
             
     | 
| 30 | 
         
            +
             
     | 
| 31 | 
         
            +
            messages = [
         
     | 
| 32 | 
         
            +
                {"role": "user", "content": "What is your favourite condiment?"},
         
     | 
| 33 | 
         
            +
                {"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!"},
         
     | 
| 34 | 
         
            +
                {"role": "user", "content": "Do you have mayonnaise recipes?"}
         
     | 
| 35 | 
         
            +
            ]
         
     | 
| 36 | 
         
            +
             
     | 
| 37 | 
         
            +
            inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
         
     | 
| 38 | 
         
            +
             
     | 
| 39 | 
         
            +
            outputs = model.generate(inputs, max_new_tokens=20)
         
     | 
| 40 | 
         
            +
            print(tokenizer.decode(outputs[0], skip_special_tokens=True))
         
     | 
| 41 | 
         
            +
            ```
         
     | 
| 42 | 
         
            +
             
     | 
| 43 | 
         
            +
            For more examples and possible optimizations please refer [OpenVINO Large Language Model Inference Guide](https://docs.openvino.ai/2024/learn-openvino/llm_inference_guide.html)
         
     | 
| 44 | 
         
            +
             
     | 
| 45 | 
         
            +
            ### Limitations
         
     | 
| 46 | 
         
            +
             
     | 
| 47 | 
         
            +
            Please check original model card for model usage [limitations](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#limitations)
         
     | 
| 48 | 
         
            +
             
     | 
    	
        config.json
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 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 | 
         
            +
              "sliding_window": null,
         
     | 
| 25 | 
         
            +
              "tie_word_embeddings": false,
         
     | 
| 26 | 
         
            +
              "torch_dtype": "bfloat16",
         
     | 
| 27 | 
         
            +
              "transformers_version": "4.38.2",
         
     | 
| 28 | 
         
            +
              "use_cache": true,
         
     | 
| 29 | 
         
            +
              "vocab_size": 32000
         
     | 
| 30 | 
         
            +
            }
         
     | 
    	
        openvino_model.bin
    ADDED
    
    | 
         @@ -0,0 +1,3 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            version https://git-lfs.github.com/spec/v1
         
     | 
| 2 | 
         
            +
            oid sha256:d65631dc423958095dcacf7266918cc31423e8358cb23335bd0025d4e6515048
         
     | 
| 3 | 
         
            +
            size 28742920831
         
     | 
    	
        openvino_model.xml
    ADDED
    
    | 
         The diff for this file is too large to render. 
		See raw diff 
     | 
| 
         | 
    	
        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 | 
         
            +
            }
         
     |