Victarry commited on
Commit
f46377e
·
1 Parent(s): b220b81

Add requirements.

Browse files
Files changed (2) hide show
  1. src/server.py → app.py +4 -9
  2. requirements.txt +9 -0
src/server.py → app.py RENAMED
@@ -2,8 +2,6 @@ import dash
2
  import dash_bootstrap_components as dbc
3
  from dash import dcc, html, Input, Output, State, callback_context
4
  import plotly.graph_objects as go
5
- import webbrowser
6
- from threading import Timer
7
 
8
  from src.execution_model import ScheduleConfig, Schedule
9
  from src.strategies import (
@@ -16,9 +14,6 @@ from src.strategies import (
16
  )
17
  from src.visualizer import convert_schedule_to_visualization_format, create_pipeline_figure
18
 
19
- def open_browser(port):
20
- webbrowser.open_new(f"http://127.0.0.1:{port}")
21
-
22
  STRATEGIES = {
23
  "1f1b": generate_1f1b_schedule,
24
  "zb1p": generate_zero_bubble_1p_schedule,
@@ -338,8 +333,8 @@ def update_graph(n_clicks, num_devices, num_stages, num_batches, p2p_latency,
338
 
339
  return output_components
340
 
 
 
 
341
  if __name__ == '__main__':
342
- port = 8050
343
- # Timer(1, open_browser, args=(port,)).start() # Optional: automatically open browser
344
- print(f"Dash server running on http://127.0.0.1:{port}")
345
- app.run_server(debug=True, port=port)
 
2
  import dash_bootstrap_components as dbc
3
  from dash import dcc, html, Input, Output, State, callback_context
4
  import plotly.graph_objects as go
 
 
5
 
6
  from src.execution_model import ScheduleConfig, Schedule
7
  from src.strategies import (
 
14
  )
15
  from src.visualizer import convert_schedule_to_visualization_format, create_pipeline_figure
16
 
 
 
 
17
  STRATEGIES = {
18
  "1f1b": generate_1f1b_schedule,
19
  "zb1p": generate_zero_bubble_1p_schedule,
 
333
 
334
  return output_components
335
 
336
+ # For Hugging Face Spaces deployment
337
+ server = app.server
338
+
339
  if __name__ == '__main__':
340
+ app.run_server(debug=False, host='0.0.0.0', port=7860)
 
 
 
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ dash==2.14.2
2
+ plotly==5.18.0
3
+ gunicorn==21.2.0
4
+ hydra-core==1.3.2
5
+ omegaconf==2.3.0
6
+ pandas==2.1.0
7
+ numpy==1.26.0
8
+ tqdm==4.67.0
9
+ dash-bootstrap-components==1.7.1