JacksonLark commited on
Commit
e987fab
1 Parent(s): 922603b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -11,7 +11,7 @@ tags:
11
 
12
  # How to Use
13
 
14
- ```
15
  import torch
16
  from transformers import T5ForConditionalGeneration, AutoTokenizer
17
 
@@ -20,9 +20,9 @@ device = torch.device("cuda:0")
20
  tokenizer = AutoTokenizer.from_pretrained("LarkAI/codet5p-770m_nl2sql_oig")
21
  model = T5ForConditionalGeneration.from_pretrained("LarkAI/codet5p-770m_nl2sql_oig").to(device)
22
 
23
- text = "Given the following schema:\nroad (road_name, state_name)\nstate (state_name, capital, population, area, country_name, density)\nhighlow (state_name, highest_point, highest_elevation, lowest_point, lowest_elevation)\nlake (lake_name, area, state_name, country_name)\nriver (river_name, length, traverse, country_name)\nborder_info (state_name, border)\nmountain (mountain_name, mountain_altitude, state_name, country_name)\ncity (city_name, state_name, population, country_name)\nWrite a SQL query to what states does the mississippi river run throug"
24
  inputs = tokenizer.encode(text, return_tensors="pt").to(device)
25
  output_ids = model.generate(inputs, max_length=512)
26
  response_text = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
27
- # SELECT traverse FROM river WHERE river_name = \"mississippi\" ;
28
  ```
 
11
 
12
  # How to Use
13
 
14
+ ```python
15
  import torch
16
  from transformers import T5ForConditionalGeneration, AutoTokenizer
17
 
 
20
  tokenizer = AutoTokenizer.from_pretrained("LarkAI/codet5p-770m_nl2sql_oig")
21
  model = T5ForConditionalGeneration.from_pretrained("LarkAI/codet5p-770m_nl2sql_oig").to(device)
22
 
23
+ text = "Given the following schema:\ntrack (Track_ID, Name, Location, Seating, Year_Opened)\nrace (Race_ID, Name, Class, Date, Track_ID)\nWrite a SQL query to count the number of tracks."
24
  inputs = tokenizer.encode(text, return_tensors="pt").to(device)
25
  output_ids = model.generate(inputs, max_length=512)
26
  response_text = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
27
+ # SELECT COUNT( * ) FROM track
28
  ```