KheemDH commited on
Commit
ffe08d3
·
verified ·
1 Parent(s): d26d91b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -1,11 +1,19 @@
1
  from __future__ import annotations
2
 
3
  import json
 
 
4
  import textwrap
5
  from typing import List
6
 
7
  import gradio as gr
8
 
 
 
 
 
 
 
9
  from agentic_multiwriter.state import AgentState, ResearchSnippet
10
  from agentic_multiwriter.agents import (
11
  researcher_node,
@@ -142,8 +150,7 @@ def build_interface() -> gr.Blocks:
142
  sources_box = gr.Markdown(label="Web Sources Used")
143
 
144
  with gr.Tab("Meta"):
145
- meta_box = gr.Textbox(
146
- label="Meta (timings, counts, etc.)", lines=10)
147
 
148
  run_button.click(
149
  fn=generate,
@@ -162,8 +169,8 @@ def build_interface() -> gr.Blocks:
162
  """
163
  ---
164
  ⚠️ **Note**: First run may take longer while the model loads or if you are
165
- using a local model. For best performance on Hugging Face Spaces, set
166
- `AMW_LLM_PROVIDER=openai` and use a small hosted model (e.g. `gpt-4o-mini`).
167
  """
168
  )
169
  )
 
1
  from __future__ import annotations
2
 
3
  import json
4
+ import os
5
+ import sys
6
  import textwrap
7
  from typing import List
8
 
9
  import gradio as gr
10
 
11
+ # Ensure the local src/ directory is on sys.path (for Hugging Face Spaces)
12
+ ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
13
+ SRC_DIR = os.path.join(ROOT_DIR, "src")
14
+ if SRC_DIR not in sys.path:
15
+ sys.path.append(SRC_DIR)
16
+
17
  from agentic_multiwriter.state import AgentState, ResearchSnippet
18
  from agentic_multiwriter.agents import (
19
  researcher_node,
 
150
  sources_box = gr.Markdown(label="Web Sources Used")
151
 
152
  with gr.Tab("Meta"):
153
+ meta_box = gr.Textbox(label="Meta (timings, counts, etc.)", lines=10)
 
154
 
155
  run_button.click(
156
  fn=generate,
 
169
  """
170
  ---
171
  ⚠️ **Note**: First run may take longer while the model loads or if you are
172
+ using a local model. On Spaces, this app uses an open-source model via
173
+ Hugging Face Inference API.
174
  """
175
  )
176
  )