Spaces:
Runtime error
Runtime error
Download streamlit_app.py from Sujatha/Bankquant-multiagents: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/spaces/Sujatha/Bankquant-multiagents/resolve/main/streamlit_app.py
- Command line
-
hf download hf://spaces/Sujatha/Bankquant-multiagents/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/Sujatha/Bankquant-multiagents/resolve/main/streamlit_app.py
2.45 kB
| import streamlit as st | |
| import sys | |
| import os | |
| import subprocess | |
| import time | |
| # Force immediate display | |
| st.set_page_config( | |
| page_title="BankQuant AI Agents", | |
| page_icon="π¦", | |
| layout="wide", | |
| initial_sidebar_state="expanded" | |
| ) | |
| st.title("π¦ BankQuant Multi-Agent System") | |
| st.markdown("### Quantitative Finance AI Assistant Platform") | |
| # Show that we're in the right file | |
| st.success("β Running from streamlit_app.py") | |
| # Check what files exist | |
| st.markdown("### Files in current directory:") | |
| try: | |
| files = os.listdir('.') | |
| for f in sorted(files): | |
| if f.endswith('.py'): | |
| st.code(f"π {f}") | |
| else: | |
| st.text(f"π {f}") | |
| except Exception as e: | |
| st.error(f"Error listing files: {e}") | |
| # Try to import and run your app.py | |
| if os.path.exists("app.py"): | |
| st.success("β Found app.py!") | |
| # Clear module cache to force reload | |
| if 'app' in sys.modules: | |
| del sys.modules['app'] | |
| try: | |
| # Add current directory to path | |
| sys.path.insert(0, '.') | |
| # Import your app | |
| import app | |
| st.info("π Loading your QuantProdigy app...") | |
| # Check if app has a main function | |
| if hasattr(app, 'main'): | |
| # Run the main function | |
| app.main() | |
| else: | |
| st.warning("app.py doesn't have a main() function") | |
| st.markdown("### Contents of app.py:") | |
| with open("app.py", "r") as f: | |
| st.code(f.read()[:1000] + "..." if len(f.read()) > 1000 else f.read()) | |
| except Exception as e: | |
| st.error(f"β Error importing app.py: {str(e)}") | |
| import traceback | |
| with st.expander("π Full Error Traceback"): | |
| st.code(traceback.format_exc()) | |
| else: | |
| st.error("β app.py not found in root directory!") | |
| # Option to create a simple app.py | |
| if st.button("Create simple app.py for testing"): | |
| simple_app = ''' | |
| import streamlit as st | |
| st.title("Test BankQuant App") | |
| st.success("This is a test app") | |
| st.write("Your main app will load here once you upload it.") | |
| ''' | |
| with open("app.py", "w") as f: | |
| f.write(simple_app) | |
| st.success("Created app.py! Refresh to see it.") | |
| st.rerun() | |
| # Add a test section | |
| st.markdown("---") | |
| st.markdown("### Test Input") | |
| test_input = st.text_input("Enter something to test:") | |
| if test_input: | |
| st.write(f"You entered: {test_input}") |