Spaces:
Sleeping
Sleeping
Update ui/contentagentui.py
Browse files- ui/contentagentui.py +13 -12
ui/contentagentui.py
CHANGED
|
@@ -93,7 +93,18 @@ class ContentAgentUI:
|
|
| 93 |
else:
|
| 94 |
gr.Markdown("*No examples found.*")
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
# ---------- agent call ----------
|
| 98 |
|
| 99 |
|
|
@@ -113,17 +124,7 @@ class ContentAgentUI:
|
|
| 113 |
if self.app is not None:
|
| 114 |
return self.app
|
| 115 |
|
| 116 |
-
|
| 117 |
-
css_content = ""
|
| 118 |
-
css_path = os.path.join(os.getcwd(), "ui", "styles.css")
|
| 119 |
-
if ( os.path.exists(css_path)):
|
| 120 |
-
# Also check if it's readable and has content
|
| 121 |
-
with open(css_path, 'r') as f:
|
| 122 |
-
css_content = f.read()
|
| 123 |
-
print(f"CSS file size: {len(css_content)} characters")
|
| 124 |
-
|
| 125 |
-
css_content=" *, body { background: red; }"
|
| 126 |
-
with gr.Blocks(css=css_path) as demo:
|
| 127 |
# global header (always visible)
|
| 128 |
gr.Markdown("# Content Agent")
|
| 129 |
|
|
|
|
| 93 |
else:
|
| 94 |
gr.Markdown("*No examples found.*")
|
| 95 |
|
| 96 |
+
|
| 97 |
+
def _get_css(self):
|
| 98 |
+
# Optional: Adjust path if needed for hosted environments
|
| 99 |
+
css_content = ""
|
| 100 |
+
css_path = os.path.join(os.getcwd(), "ui", "styles.css")
|
| 101 |
+
if ( os.path.exists(css_path)):
|
| 102 |
+
# Also check if it's readable and has content
|
| 103 |
+
with open(css_path, 'r') as f:
|
| 104 |
+
css_content = f.read()
|
| 105 |
+
print(f"CSS file size: {len(css_content)} characters")
|
| 106 |
+
return css_content
|
| 107 |
+
|
| 108 |
# ---------- agent call ----------
|
| 109 |
|
| 110 |
|
|
|
|
| 124 |
if self.app is not None:
|
| 125 |
return self.app
|
| 126 |
|
| 127 |
+
with gr.Blocks(css=self._get_css()) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
# global header (always visible)
|
| 129 |
gr.Markdown("# Content Agent")
|
| 130 |
|