frankmorales2020 commited on
Commit
0e1ff36
1 Parent(s): 3b60d9a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -20,6 +20,26 @@ should probably proofread and complete it, then remove this comment. -->
20
 
21
  This model is a fine-tuned version of [mistralai/Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1) on the generator dataset.
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ## Model description
24
 
25
  More information needed
 
20
 
21
  This model is a fine-tuned version of [mistralai/Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1) on the generator dataset.
22
 
23
+ ## USE CASE
24
+
25
+ import torch
26
+ from peft import AutoPeftModelForCausalLM
27
+ from transformers import AutoTokenizer, pipeline
28
+
29
+ peft_model_id = "frankmorales2020/Mistral-7B-text-to-sql"
30
+ # peft_model_id = args.output_dir
31
+
32
+ # Load Model with PEFT adapter
33
+ model = AutoPeftModelForCausalLM.from_pretrained(
34
+ peft_model_id,
35
+ device_map="auto",
36
+ torch_dtype=torch.float16
37
+ )
38
+ tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
39
+ # Load into the pipeline
40
+ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
41
+
42
+
43
  ## Model description
44
 
45
  More information needed