Manoj Kumar
commited on
Commit
·
83ce0d2
1
Parent(s):
c8e1797
updated question structure
Browse files
app.py
CHANGED
@@ -16,22 +16,21 @@ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torc
|
|
16 |
|
17 |
def generate_sql_query(context, question):
|
18 |
"""
|
19 |
-
|
|
|
20 |
|
21 |
Args:
|
22 |
context (str): Description of the database schema or table relationships.
|
23 |
question (str): User's natural language query.
|
24 |
|
25 |
Returns:
|
26 |
-
str:
|
27 |
"""
|
28 |
# Prepare the prompt
|
29 |
prompt = f"""
|
30 |
Context: {context}
|
31 |
|
32 |
Question: {question}
|
33 |
-
|
34 |
-
Write an SQL query to address the question based on the context.
|
35 |
Query:
|
36 |
"""
|
37 |
# Tokenize input
|
|
|
16 |
|
17 |
def generate_sql_query(context, question):
|
18 |
"""
|
19 |
+
This is the description of the database which is given to you, a user can ask
|
20 |
+
anything related to this database
|
21 |
|
22 |
Args:
|
23 |
context (str): Description of the database schema or table relationships.
|
24 |
question (str): User's natural language query.
|
25 |
|
26 |
Returns:
|
27 |
+
str: An answer to the question.
|
28 |
"""
|
29 |
# Prepare the prompt
|
30 |
prompt = f"""
|
31 |
Context: {context}
|
32 |
|
33 |
Question: {question}
|
|
|
|
|
34 |
Query:
|
35 |
"""
|
36 |
# Tokenize input
|