ansumanpandey commited on
Commit
03a71d9
·
verified ·
1 Parent(s): 1ff5855

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +50 -0
README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: apache-2.0
4
+ datasets:
5
+ - custom_dataset_for_sql_generation
6
+ tags:
7
+ - natural-language-processing
8
+ - code-generation
9
+ - sql
10
+ - transformers
11
+ - finetuned-model
12
+ model-index:
13
+ - name: Finetuned CodeGen for SQL Query Generation
14
+ results:
15
+ - task:
16
+ name: SQL Code Generation
17
+ type: code-generation
18
+
19
+
20
+ # Finetuned CodeGen for SQL Query Generation
21
+
22
+ ## Model Description
23
+
24
+ This model is a fine-tuned version of the Salesforce CodeGen model with 350M parameters, specialized in generating SQL queries from plain English text descriptions. It leverages the power of large language models to understand natural language and convert it into executable SQL, making it easier for analysts, developers, and data enthusiasts to interact with databases without deep SQL expertise.
25
+
26
+ ## Intended Use
27
+
28
+ This model is intended for the automatic generation of SQL queries from descriptions in English. It can be used to:
29
+ - Quickly generate sample SQL queries for database analysis and reporting.
30
+ - Assist in educational environments for learning SQL syntax.
31
+ - Provide non-technical users with the ability to know how to retrieve data from databases using natural language.
32
+
33
+ ## How to Use
34
+
35
+ This model can be used with the Hugging Face Transformers library. Here is a quick example:
36
+
37
+ from transformers import AutoTokenizer, AutoModelForCausalLM
38
+
39
+ tokenizer = AutoTokenizer.from_pretrained("ansumanpandey/codgen-finetuned-SQLQueryGeneration")
40
+ model = AutoModelForCausalLM.from_pretrained("ansumanpandey/codgen-finetuned-SQLQueryGeneration")
41
+
42
+ def get_sql(query):
43
+ input_text = "Write a SQL query to %s </s>" % query
44
+ features = tokenizer([input_text], return_tensors='pt')
45
+
46
+ output = model.generate(input_ids=features['input_ids'],
47
+ attention_mask=features['attention_mask'],
48
+ max_new_tokens=70)
49
+ sql_query= tokenizer.decode(output[0])
50
+ return sql_query