baba521 commited on
Commit
257ea8e
·
1 Parent(s): 130f040
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -1663,16 +1663,16 @@ def create_chat_panel():
1663
  queue=True,
1664
  )
1665
 
1666
- def load_css_files(css_dir, filenames):
1667
- css_content = ""
1668
- for filename in filenames:
1669
- path = os.path.join(css_dir, filename)
1670
- if os.path.exists(path):
1671
- with open(path, "r", encoding="utf-8") as f:
1672
- css_content += f.read() + "\n"
1673
- else:
1674
- print(f"⚠️ CSS file not found: {path}")
1675
- return css_content
1676
  def main():
1677
  # 获取当前目录
1678
  current_dir = os.path.dirname(os.path.abspath(__file__))
@@ -1690,25 +1690,25 @@ def main():
1690
  # print(f"Warning: CSS file not found: {path}")
1691
  # return css_content
1692
  # 设置CSS路径
1693
- # css_paths = [
1694
- # os.path.join(css_dir, "main.css"),
1695
- # os.path.join(css_dir, "components.css"),
1696
- # os.path.join(css_dir, "layout.css")
1697
- # ]
1698
  # css_dir = "path/to/your/css/folder" # 替换为你的实际路径
1699
  # 自动定位 css 文件夹(与 app.py 同级)
1700
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
1701
- CSS_DIR = os.path.join(BASE_DIR, "css")
1702
 
1703
- css_files = ["main.css", "components.css", "layout.css"]
1704
- combined_css = load_css_files(CSS_DIR, css_files)
1705
- print(combined_css)
1706
 
1707
  with gr.Blocks(
1708
  title="Financial Analysis Dashboard",
1709
- # css_paths=css_paths,
1710
- # css=custom_css,
1711
- css=combined_css
1712
  ) as demo:
1713
 
1714
  # 添加处理公司点击事件的路由
@@ -1915,4 +1915,4 @@ def main():
1915
 
1916
  if __name__ == "__main__":
1917
  demo = main()
1918
- demo.launch(ssr_mode=False, share=True)
 
1663
  queue=True,
1664
  )
1665
 
1666
+ # def load_css_files(css_dir, filenames):
1667
+ # css_content = ""
1668
+ # for filename in filenames:
1669
+ # path = os.path.join(css_dir, filename)
1670
+ # if os.path.exists(path):
1671
+ # with open(path, "r", encoding="utf-8") as f:
1672
+ # css_content += f.read() + "\n"
1673
+ # else:
1674
+ # print(f"⚠️ CSS file not found: {path}")
1675
+ # return css_content
1676
  def main():
1677
  # 获取当前目录
1678
  current_dir = os.path.dirname(os.path.abspath(__file__))
 
1690
  # print(f"Warning: CSS file not found: {path}")
1691
  # return css_content
1692
  # 设置CSS路径
1693
+ css_paths = [
1694
+ os.path.join(css_dir, "main.css"),
1695
+ os.path.join(css_dir, "components.css"),
1696
+ os.path.join(css_dir, "layout.css")
1697
+ ]
1698
  # css_dir = "path/to/your/css/folder" # 替换为你的实际路径
1699
  # 自动定位 css 文件夹(与 app.py 同级)
1700
+ # BASE_DIR = os.path.dirname(os.path.abspath(__file__))
1701
+ # CSS_DIR = os.path.join(BASE_DIR, "css")
1702
 
1703
+ # css_files = ["main.css", "components.css", "layout.css"]
1704
+ # combined_css = load_css_files(CSS_DIR, css_files)
1705
+ # print(combined_css)
1706
 
1707
  with gr.Blocks(
1708
  title="Financial Analysis Dashboard",
1709
+ css_paths=css_paths,
1710
+ css=custom_css,
1711
+ # css=combined_css
1712
  ) as demo:
1713
 
1714
  # 添加处理公司点击事件的路由
 
1915
 
1916
  if __name__ == "__main__":
1917
  demo = main()
1918
+ demo.launch(share=True)