tommyaie99 commited on
Commit
317bb3f
·
1 Parent(s): ecf0796

fix: nebius token is now passed as gradio secret

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -34,6 +34,12 @@ async def chat_logic(
34
  Yields:
35
  str: The bot's streaming response or an interruption message.
36
  """
 
 
 
 
 
 
37
  # Retrieve the initialized graph and interrupt handler from the session state.
38
  app = session_state.get("app")
39
  human_resume_node = session_state.get("human_resume_node")
@@ -186,12 +192,7 @@ def create_gradio_app():
186
  type="password",
187
  info="A token generated from your Trello account.",
188
  )
189
- hf_token = gr.Textbox(
190
- label="🤗 Hugging Face Token",
191
- placeholder="hf_xxxxxxxxxxxx",
192
- type="password",
193
- info="Used for tools requiring Hugging Face models.",
194
- )
195
 
196
  with gr.Column(scale=2):
197
  chatbot = gr.Chatbot(
@@ -237,7 +238,6 @@ def create_gradio_app():
237
  github_token,
238
  trello_api,
239
  trello_token,
240
- hf_token,
241
  ],
242
  title=None,
243
  description="Ask **PMCP** to create tickets, open PRs, or coordinate tasks across your boards and repositories.",
 
34
  Yields:
35
  str: The bot's streaming response or an interruption message.
36
  """
37
+
38
+ # Load Hugging Face token from environment (passed as Gradio secret or set locally)
39
+ hf_token = os.getenv("NEBIUS_API_KEY")
40
+ if not hf_token:
41
+ yield "Error: LLM token not found. Please set the token as environment variable or configure it as a Gradio secret."
42
+ return
43
  # Retrieve the initialized graph and interrupt handler from the session state.
44
  app = session_state.get("app")
45
  human_resume_node = session_state.get("human_resume_node")
 
192
  type="password",
193
  info="A token generated from your Trello account.",
194
  )
195
+
 
 
 
 
 
196
 
197
  with gr.Column(scale=2):
198
  chatbot = gr.Chatbot(
 
238
  github_token,
239
  trello_api,
240
  trello_token,
 
241
  ],
242
  title=None,
243
  description="Ask **PMCP** to create tickets, open PRs, or coordinate tasks across your boards and repositories.",