Sarvamangalak commited on
Commit
f01c156
·
verified ·
1 Parent(s): 778f1ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -50,6 +50,9 @@ LLM_MODEL = "openai/gpt-oss-120b"
50
 
51
  HF_TOKEN = os.getenv("HF_TOKEN")
52
 
 
 
 
53
  llm_client = None
54
 
55
  if HF_TOKEN and HF_TOKEN.strip():
@@ -68,19 +71,13 @@ if HF_TOKEN and HF_TOKEN.strip():
68
 
69
  except Exception as e:
70
 
71
- print("========================================")
72
- print("✗ LLM initialization failed")
73
- print("Error:", str(e))
74
- print("========================================")
75
 
76
  llm_client = None
77
 
78
  else:
79
 
80
- print("========================================")
81
  print("⚠ HF_TOKEN not found")
82
- print("Add HF_TOKEN to Space Secrets")
83
- print("========================================")
84
 
85
 
86
  # ============================================================
@@ -1767,7 +1764,6 @@ h1 {
1767
  # ============================================================
1768
 
1769
  with gr.Blocks(
1770
- css=css,
1771
  title="Smart Traffic & EV Analytics"
1772
  ) as demo:
1773
 
@@ -2057,11 +2053,11 @@ response, and create a relevant visualization.
2057
  # ============================================================
2058
  # LAUNCH
2059
  # ============================================================
2060
-
2061
  if __name__ == "__main__":
2062
 
2063
  demo.queue()
2064
 
2065
  demo.launch(
2066
- ssr_mode=False
 
2067
  )
 
50
 
51
  HF_TOKEN = os.getenv("HF_TOKEN")
52
 
53
+ if HF_TOKEN:
54
+ os.environ["HF_HUB_TOKEN"] = HF_TOKEN.strip()
55
+
56
  llm_client = None
57
 
58
  if HF_TOKEN and HF_TOKEN.strip():
 
71
 
72
  except Exception as e:
73
 
74
+ print("LLM initialization error:", str(e))
 
 
 
75
 
76
  llm_client = None
77
 
78
  else:
79
 
 
80
  print("⚠ HF_TOKEN not found")
 
 
81
 
82
 
83
  # ============================================================
 
1764
  # ============================================================
1765
 
1766
  with gr.Blocks(
 
1767
  title="Smart Traffic & EV Analytics"
1768
  ) as demo:
1769
 
 
2053
  # ============================================================
2054
  # LAUNCH
2055
  # ============================================================
 
2056
  if __name__ == "__main__":
2057
 
2058
  demo.queue()
2059
 
2060
  demo.launch(
2061
+ ssr_mode=False,
2062
+ css=css
2063
  )