Spaces:
Sleeping
Sleeping
add in db stuff
Browse files
app.py
CHANGED
@@ -52,6 +52,14 @@ examples_prompt = PromptTemplate(
|
|
52 |
def get_potential_labels():
|
53 |
# get potential labels from db
|
54 |
global potential_labels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
potential_labels = db_cursor.execute(
|
56 |
"SELECT message_category_name FROM radmap_frog12.message_categorys"
|
57 |
)
|
|
|
52 |
def get_potential_labels():
|
53 |
# get potential labels from db
|
54 |
global potential_labels
|
55 |
+
db_connection = mysql.connector.connect(
|
56 |
+
host=db_host,
|
57 |
+
user=db_user,
|
58 |
+
password=db_pass,
|
59 |
+
database=db_name,
|
60 |
+
)
|
61 |
+
|
62 |
+
db_cursor = db_connection.cursor()
|
63 |
potential_labels = db_cursor.execute(
|
64 |
"SELECT message_category_name FROM radmap_frog12.message_categorys"
|
65 |
)
|