File size: 1,937 Bytes
c3c1eca
 
 
 
 
 
 
 
 
 
e7a519f
 
 
c3c1eca
 
52e05e7
c3c1eca
 
 
 
 
 
 
52e05e7
c3c1eca
 
 
 
 
 
 
 
 
 
 
 
 
 
52e05e7
c3c1eca
 
 
 
 
 
 
 
 
 
 
52e05e7
 
c3c1eca
 
52e05e7
 
 
c3c1eca
 
 
 
 
 
 
 
 
 
 
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
license: apache-2.0
tags:
- finetuned
pipeline_tag: text-generation
inference: true
widget:
- messages:
  - role: user
    content: What is your favorite condiment?
extra_gated_description: >-
  If you want to learn more about how we process your personal data, please read
  our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
---

# Model Card for shaheerzk/text-to-rdb-queries


## Inference with hugging face `transformers`
 
```py
from transformers import AutoModelForCausalLM
 
model = AutoModelForCausalLM.from_pretrained("shaheerzk/text-to-rdb-queries")
model.to("cuda")
 
generated_ids = model.generate(tokens, max_new_tokens=1000, do_sample=True)

# decode with mistral tokenizer
result = tokenizer.decode(generated_ids[0].tolist())
print(result)
```

> [!TIP]
> PRs to correct the `transformers` tokenizer so that it gives 1-to-1 the same results as the `mistral_common` reference implementation are very welcome!
            
---

The shaheerzk/text-to-rdb-queries Large Language Model (LLM) is an instruct fine-tuned version of the Mistral-7B-v0.2.


## Instruction format

This format is available as a [chat template](https://huggingface.co./docs/transformers/main/chat_templating) via the `apply_chat_template()` method:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained("shaheerzk/text-to-rdb-queries")
tokenizer = AutoTokenizer.from_pretrained("shaheerzk/text-to-rdb-queries")

messages = [
    {"role": "user", "content": ""},
    {"role": "assistant", "content": ""},
    {"role": "user", "content": ""}
]

encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")

model_inputs = encodeds.to(device)
model.to(device)

generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
```