Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,15 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
13 |
|
14 |
# TimescaleDB config (via Hugging Face Space secrets)
|
15 |
DB_CONFIG = {
|
16 |
-
"host": "127.0.0.1", # Use
|
17 |
-
"port": os.getenv("DB_PORT", 5434),
|
18 |
"database": os.getenv("DB_NAME", "postgres"),
|
19 |
"user": os.getenv("DB_USER", "postgres"),
|
20 |
"password": os.getenv("DB_PASSWORD", "password"),
|
21 |
}
|
22 |
|
23 |
|
|
|
24 |
# Query TimescaleDB with improved error handling
|
25 |
def query_timescaledb(sql_query):
|
26 |
try:
|
|
|
13 |
|
14 |
# TimescaleDB config (via Hugging Face Space secrets)
|
15 |
DB_CONFIG = {
|
16 |
+
"host": os.getenv("DB_HOST", "127.0.0.1"), # Use the actual DB host
|
17 |
+
"port": os.getenv("DB_PORT", 5434),
|
18 |
"database": os.getenv("DB_NAME", "postgres"),
|
19 |
"user": os.getenv("DB_USER", "postgres"),
|
20 |
"password": os.getenv("DB_PASSWORD", "password"),
|
21 |
}
|
22 |
|
23 |
|
24 |
+
|
25 |
# Query TimescaleDB with improved error handling
|
26 |
def query_timescaledb(sql_query):
|
27 |
try:
|