You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
4.0 KiB

1 month ago
  1. # Kronos Web UI
  2. Web user interface for Kronos financial prediction model, providing intuitive graphical operation interface.
  3. ## ✨ Features
  4. - **Multi-format data support**: Supports CSV, Feather and other financial data formats
  5. - **Smart time window**: Fixed 400+120 data point time window slider selection
  6. - **Real model prediction**: Integrated real Kronos model, supports multiple model sizes
  7. - **Prediction quality control**: Adjustable temperature, nucleus sampling, sample count and other parameters
  8. - **Multi-device support**: Supports CPU, CUDA, MPS and other computing devices
  9. - **Comparison analysis**: Detailed comparison between prediction results and actual data
  10. - **K-line chart display**: Professional financial K-line chart display
  11. ## 🚀 Quick Start
  12. ### Method 1: Start with Python script
  13. ```bash
  14. cd webui
  15. python run.py
  16. ```
  17. ### Method 2: Start with Shell script
  18. ```bash
  19. cd webui
  20. chmod +x start.sh
  21. ./start.sh
  22. ```
  23. ### Method 3: Start Flask application directly
  24. ```bash
  25. cd webui
  26. python app.py
  27. ```
  28. After successful startup, visit http://localhost:7070
  29. ## 📋 Usage Steps
  30. 1. **Load data**: Select financial data file from data directory
  31. 2. **Load model**: Select Kronos model and computing device
  32. 3. **Set parameters**: Adjust prediction quality parameters
  33. 4. **Select time window**: Use slider to select 400+120 data point time range
  34. 5. **Start prediction**: Click prediction button to generate results
  35. 6. **View results**: View prediction results in charts and tables
  36. ## 🔧 Prediction Quality Parameters
  37. ### Temperature (T)
  38. - **Range**: 0.1 - 2.0
  39. - **Effect**: Controls prediction randomness
  40. - **Recommendation**: 1.2-1.5 for better prediction quality
  41. ### Nucleus Sampling (top_p)
  42. - **Range**: 0.1 - 1.0
  43. - **Effect**: Controls prediction diversity
  44. - **Recommendation**: 0.95-1.0 to consider more possibilities
  45. ### Sample Count
  46. - **Range**: 1 - 5
  47. - **Effect**: Generate multiple prediction samples
  48. - **Recommendation**: 2-3 samples to improve quality
  49. ## 📊 Supported Data Formats
  50. ### Required Columns
  51. - `open`: Opening price
  52. - `high`: Highest price
  53. - `low`: Lowest price
  54. - `close`: Closing price
  55. ### Optional Columns
  56. - `volume`: Trading volume
  57. - `amount`: Trading amount (not used for prediction)
  58. - `timestamps`/`timestamp`/`date`: Timestamp
  59. ## 🤖 Model Support
  60. - **Kronos-mini**: 4.1M parameters, lightweight fast prediction
  61. - **Kronos-small**: 24.7M parameters, balanced performance and speed
  62. - **Kronos-base**: 102.3M parameters, high quality prediction
  63. ## 🖥️ GPU Acceleration Support
  64. - **CPU**: General computing, best compatibility
  65. - **CUDA**: NVIDIA GPU acceleration, best performance
  66. - **MPS**: Apple Silicon GPU acceleration, recommended for Mac users
  67. ## ⚠️ Notes
  68. - `amount` column is not used for prediction, only for display
  69. - Time window is fixed at 400+120=520 data points
  70. - Ensure data file contains sufficient historical data
  71. - First model loading may require download, please be patient
  72. ## 🔍 Comparison Analysis
  73. The system automatically provides comparison analysis between prediction results and actual data, including:
  74. - Price difference statistics
  75. - Error analysis
  76. - Prediction quality assessment
  77. ## 🛠️ Technical Architecture
  78. - **Backend**: Flask + Python
  79. - **Frontend**: HTML + CSS + JavaScript
  80. - **Charts**: Plotly.js
  81. - **Data processing**: Pandas + NumPy
  82. - **Model**: Hugging Face Transformers
  83. ## 📝 Troubleshooting
  84. ### Common Issues
  85. 1. **Port occupied**: Modify port number in app.py
  86. 2. **Missing dependencies**: Run `pip install -r requirements.txt`
  87. 3. **Model loading failed**: Check network connection and model ID
  88. 4. **Data format error**: Ensure data column names and format are correct
  89. ### Log Viewing
  90. Detailed runtime information will be displayed in the console at startup, including model status and error messages.
  91. ## 📄 License
  92. This project follows the license terms of the original Kronos project.
  93. ## 🤝 Contributing
  94. Welcome to submit Issues and Pull Requests to improve this Web UI!
  95. ## 📞 Support
  96. If you have questions, please check:
  97. 1. Project documentation
  98. 2. GitHub Issues
  99. 3. Console error messages