khanhamzawiser commited on
Commit
75da7aa
·
verified ·
1 Parent(s): b8499ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 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:
 
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: