Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 166 |
-
|
| 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 |
)
|