File size: 1,438 Bytes
88140ea
5018752
 
 
 
 
 
88140ea
 
e8fce12
 
2e3111c
e8fce12
 
 
 
 
 
2e3111c
e8fce12
2e3111c
e8fce12
 
 
 
2e3111c
e8fce12
 
 
 
 
2e3111c
e8fce12
5018752
e8fce12
5018752
e8fce12
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
base_model: ariG23498/Mistral-7B-Instruct-v0.3
tags:
- generated_from_keras_callback
model-index:
- name: Mistral-7B-Instruct-v0.3
  results: []
---

Turns out that [Mistral-7B-Instruct-v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) only have safetensors. This repo
is created to have the `.bin` files of the model.

This repo is created by:
```py
model_id = "mistralai/Mistral-7B-Instruct-v0.3"
model = AutoModelForCausalLM.from_pretrained(model_id)
model.push_to_hub("ariG23498/Mistral-7B-Instruct-v0.3", safe_serialization=False)
```

This is due to the fact that the TensorFlow port cannot use safetensors and need bin files.

You can use this model with TF like so:
```py
model_tf = TFAutoModelForCausalLM.from_pretrained("ariG23498/Mistral-7B-Instruct-v0.3", from_pt=True)
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")

prompt = "My favourite condiment is"
model_inputs = tokenizer([prompt], return_tensors="tf")
generated_ids = model_tf.generate(**model_inputs, max_new_tokens=100, do_sample=True)
tokenizer.batch_decode(generated_ids)[0]
```

As soon as the safetensors and TensorFlow issue is sorted one can ditch this repository and use the official repository!

Update:

I have uploaded the `.h5` models as well. You can now use the following and make the entire code work!
```py
model_tf = TFAutoModelForCausalLM.from_pretrained("ariG23498/Mistral-7B-Instruct-v0.3")
```