fkalpana commited on
Commit
ecc7032
Β·
verified Β·
1 Parent(s): 92ce176

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -6,14 +6,14 @@ from datasets import load_dataset
6
  tokenizer = T5Tokenizer.from_pretrained('t5-small', legacy=False)
7
  model = T5ForConditionalGeneration.from_pretrained('t5-small')
8
 
9
- dataset = load_dataset("b-mc2/sql-create-context", split='train')
10
 
11
- examples = []
12
 
13
- for i in range(3): # Let's take the first 3 examples
14
- item = dataset[i]
15
- question = item['question']
16
- examples.append([question])
17
 
18
  def generate_sql(question):
19
  # Format the question for the model if needed. For example:
@@ -38,7 +38,7 @@ iface = gr.Interface(
38
  outputs=gr.Textbox(),
39
  title="Natural Language to SQL",
40
  description="This app uses a Seq2Seq model to generate SQL queries from natural language questions.",
41
- examples=examples
42
  )
43
 
44
  # Launch the app
 
6
  tokenizer = T5Tokenizer.from_pretrained('t5-small', legacy=False)
7
  model = T5ForConditionalGeneration.from_pretrained('t5-small')
8
 
9
+ dataset = load_dataset("b-mc2/sql-create-context")
10
 
11
+ # examples = []
12
 
13
+ # for i in range(3): # Let's take the first 3 examples
14
+ # item = dataset[i]
15
+ # question = item['question']
16
+ # examples.append([question])
17
 
18
  def generate_sql(question):
19
  # Format the question for the model if needed. For example:
 
38
  outputs=gr.Textbox(),
39
  title="Natural Language to SQL",
40
  description="This app uses a Seq2Seq model to generate SQL queries from natural language questions.",
41
+ # examples=examples
42
  )
43
 
44
  # Launch the app