Spaces:
Sleeping
Sleeping
nileshhanotia
commited on
Commit
•
c923b38
1
Parent(s):
fdb160a
Update sql_generator.py
Browse files- sql_generator.py +9 -9
sql_generator.py
CHANGED
@@ -39,16 +39,16 @@ class SQLGenerator:
|
|
39 |
### Question: {natural_language_query}
|
40 |
### SQL Query:"""
|
41 |
|
42 |
-
inputs = self.tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(self.model.device)
|
43 |
outputs = self.model.generate(
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
return self.tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
|
53 |
|
54 |
def fetch_shopify_data(self, endpoint):
|
|
|
39 |
### Question: {natural_language_query}
|
40 |
### SQL Query:"""
|
41 |
|
|
|
42 |
outputs = self.model.generate(
|
43 |
+
inputs["input_ids"],
|
44 |
+
max_length=256,
|
45 |
+
do_sample=False,
|
46 |
+
num_return_sequences=1,
|
47 |
+
eos_token_id=self.tokenizer.eos_token_id,
|
48 |
+
pad_token_id=self.tokenizer.pad_token_id,
|
49 |
+
temperature=0.7, # Adjust temperature for more creative output
|
50 |
+
top_k=50 # Consider top k predictions for variability
|
51 |
+
)
|
52 |
return self.tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
|
53 |
|
54 |
def fetch_shopify_data(self, endpoint):
|