helenai commited on
Commit
910cc45
·
1 Parent(s): 8478ce5

commit files to HF hub

Browse files
Files changed (6) hide show
  1. README.md +4 -2
  2. config.json +1 -1
  3. inference.py +2 -2
  4. openvino_model.bin +2 -2
  5. openvino_model.xml +0 -0
  6. tokenizer.json +2 -2
README.md CHANGED
@@ -7,9 +7,11 @@ tags:
7
 
8
  # mistralai/Mistral-7B-Instruct-v0.2
9
 
10
- This is the [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) model, quantized with An example of how to do inference on this model:
 
 
11
  ```python
12
- from optimum.intel.openvino import OVModelForCausalLM
13
  from transformers import AutoTokenizer, pipeline
14
 
15
  # model_id should be set to either a local directory or a model available on the HuggingFace hub.
 
7
 
8
  # mistralai/Mistral-7B-Instruct-v0.2
9
 
10
+ This is the [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) model converted to [OpenVINO](https://openvino.ai), for accelerated inference.
11
+
12
+ An example of how to do inference on this model:
13
  ```python
14
+ from optimum.intel import OVModelForCausalLM
15
  from transformers import AutoTokenizer, pipeline
16
 
17
  # model_id should be set to either a local directory or a model available on the HuggingFace hub.
config.json CHANGED
@@ -21,7 +21,7 @@
21
  "sliding_window": null,
22
  "tie_word_embeddings": false,
23
  "torch_dtype": "bfloat16",
24
- "transformers_version": "4.37.2",
25
  "use_cache": true,
26
  "vocab_size": 32000
27
  }
 
21
  "sliding_window": null,
22
  "tie_word_embeddings": false,
23
  "torch_dtype": "bfloat16",
24
+ "transformers_version": "4.40.2",
25
  "use_cache": true,
26
  "vocab_size": 32000
27
  }
inference.py CHANGED
@@ -1,10 +1,10 @@
1
- from optimum.intel.openvino import OVModelForCausalLM
2
  from transformers import AutoTokenizer, pipeline
3
 
4
  # model_id should be set to either a local directory or a model available on the HuggingFace hub.
5
  model_id = "helenai/mistralai-Mistral-7B-Instruct-v0.2-ov"
6
  tokenizer = AutoTokenizer.from_pretrained(model_id)
7
- model = OVModelForCausalLM.from_pretrained(model_id, revision='int8-ptq')
8
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
9
  result = pipe("hello world")
10
  print(result)
 
1
+ from optimum.intel import OVModelForCausalLM
2
  from transformers import AutoTokenizer, pipeline
3
 
4
  # model_id should be set to either a local directory or a model available on the HuggingFace hub.
5
  model_id = "helenai/mistralai-Mistral-7B-Instruct-v0.2-ov"
6
  tokenizer = AutoTokenizer.from_pretrained(model_id)
7
+ model = OVModelForCausalLM.from_pretrained(model_id)
8
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
9
  result = pipe("hello world")
10
  print(result)
openvino_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c87aaf4a0409c66efe34b90babb9b874b306e69aa28ada4d4b448dd71ee22e95
3
- size 7280406372
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45dc61bad946196600fbbc9cd6cdaf4a87bb28f49abfe63c8c0f078e96ef4ffb
3
+ size 14500241654
openvino_model.xml CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fc4f0bd70b3709312d9d1d9e5ba674794b6bc5abc17429897a540f93882f25fc
3
- size 1795303
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdc45dc7f18a5c55e0dcb36f4f187a7c429d6aaa1693a17d20422b85081642d9
3
+ size 1795331