Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,13 +13,14 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
13 |
|
14 |
# TimescaleDB config (via Hugging Face Space secrets)
|
15 |
DB_CONFIG = {
|
16 |
-
"host":
|
17 |
-
"port": os.getenv("DB_PORT", 5434),
|
18 |
-
"database": os.getenv("postgres"),
|
19 |
-
"user": os.getenv("postgres"),
|
20 |
-
"password": os.getenv("password"),
|
21 |
}
|
22 |
|
|
|
23 |
# Query TimescaleDB with improved error handling
|
24 |
def query_timescaledb(sql_query):
|
25 |
try:
|
|
|
13 |
|
14 |
# TimescaleDB config (via Hugging Face Space secrets)
|
15 |
DB_CONFIG = {
|
16 |
+
"host": "127.0.0.1", # Use TCP/IP connection instead of Unix socket
|
17 |
+
"port": os.getenv("DB_PORT", 5434), # Ensure this is the correct port
|
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:
|