ekshat commited on
Commit
1a75b9e
1 Parent(s): cfcf518

Upload model

Browse files
Files changed (3) hide show
  1. README.md +14 -44
  2. adapter_config.json +21 -0
  3. adapter_model.bin +3 -0
README.md CHANGED
@@ -1,50 +1,20 @@
1
  ---
2
- datasets:
3
- - b-mc2/sql-create-context
4
- language:
5
- - en
6
- library_name: transformers
7
- pipeline_tag: text2text-generation
8
- tags:
9
- - text-2-sql
10
- - text-generation-inference
11
  ---
12
- This Model is based on Llama-2 7B model provided by Meta. The Model accepts text and return SQL-query. This Model has been fine-tuned on "NousResearch/Llama-2-7b-hf".
13
 
14
- ```python
15
- ! pip install transformers accelerate
16
 
17
- # Use a pipeline as a high-level helper
18
- from transformers import pipeline
 
 
 
 
 
 
 
 
 
19
 
20
- pipe = pipeline("text2text-generation", model="ekshat/Llama-2-7b-chat-finetune-for-text2sql")
21
 
22
- # Load model directly
23
- from transformers import AutoTokenizer, AutoModelForCausalLM
24
-
25
- tokenizer = AutoTokenizer.from_pretrained("ekshat/Llama-2-7b-chat-finetune-for-text2sql")
26
- model = AutoModelForCausalLM.from_pretrained("ekshat/Llama-2-7b-chat-finetune-for-text2sql")
27
-
28
- # Run text generation pipeline with our model
29
- context = "CREATE TABLE Student (name VARCHAR, college VARCHAR, age VARCHAR, group VARCHAR, marks VARCHAR)"
30
- question = "List the name of Students belongs to school 'St. Xavier' and having marks greater than '600'"
31
-
32
- prompt = f"""Below is an context that describes a sql query, paired with an question that provides further information. Write an answer that appropriately completes the request.
33
- ### Context:
34
- {context}
35
- ### Question:
36
- {question}
37
- ### Answer:"""
38
-
39
- sequences = pipeline(
40
- prompt,
41
- do_sample=True,
42
- top_k=10,
43
- num_return_sequences=1,
44
- eos_token_id=tokenizer.eos_token_id,
45
- max_length=200,
46
- )
47
- for seq in sequences:
48
- print(f"Result: {seq['generated_text']}")
49
-
50
- ```
 
1
  ---
2
+ library_name: peft
 
 
 
 
 
 
 
 
3
  ---
4
+ ## Training procedure
5
 
 
 
6
 
7
+ The following `bitsandbytes` quantization config was used during training:
8
+ - load_in_8bit: False
9
+ - load_in_4bit: True
10
+ - llm_int8_threshold: 6.0
11
+ - llm_int8_skip_modules: None
12
+ - llm_int8_enable_fp32_cpu_offload: False
13
+ - llm_int8_has_fp16_weight: False
14
+ - bnb_4bit_quant_type: nf4
15
+ - bnb_4bit_use_double_quant: False
16
+ - bnb_4bit_compute_dtype: float16
17
+ ### Framework versions
18
 
 
19
 
20
+ - PEFT 0.4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
adapter_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_mapping": null,
3
+ "base_model_name_or_path": "NousResearch/Llama-2-7b-chat-hf",
4
+ "bias": "none",
5
+ "fan_in_fan_out": false,
6
+ "inference_mode": true,
7
+ "init_lora_weights": true,
8
+ "layers_pattern": null,
9
+ "layers_to_transform": null,
10
+ "lora_alpha": 16,
11
+ "lora_dropout": 0.1,
12
+ "modules_to_save": null,
13
+ "peft_type": "LORA",
14
+ "r": 64,
15
+ "revision": null,
16
+ "target_modules": [
17
+ "q_proj",
18
+ "v_proj"
19
+ ],
20
+ "task_type": "CAUSAL_LM"
21
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd705fa039e2242dfbb7e123b1872f50affc63ba46e708cc9a39b0c471c01340
3
+ size 134263757