Pierre918 commited on
Commit
7457269
·
verified ·
1 Parent(s): b6c1ace

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -87,8 +87,8 @@ def predire(date):
87
  # Définir le symbole du S&P 500
88
  symbole = "^GSPC"
89
 
90
- selected_date=datetime.fromtimestamp(date)
91
- year, month, day = selected_date.year, selected_date.month, selected_date.day
92
  print(year,month,day)
93
  # Définir la période
94
  def get_datas(year,month,day):
@@ -181,9 +181,10 @@ with gr.Blocks() as demo:
181
  with gr.Column():
182
  btn = gr.Button("Show Results")
183
  gr.Markdown("## Dynamic prediction")
 
184
  with gr.Row():
185
  with gr.Column():
186
- date_input = gr.DateTime(label="Select Date")
187
  prediction = gr.Textbox(label="Prediction")
188
  with gr.Column():
189
  true_val = gr.Textbox("Real close price")
 
87
  # Définir le symbole du S&P 500
88
  symbole = "^GSPC"
89
 
90
+ # selected_date=datetime.fromtimestamp(date)
91
+ day, month,year = int(date.split('/')[0]),int(date.split('/')[1]),int(date.split('/')[2])
92
  print(year,month,day)
93
  # Définir la période
94
  def get_datas(year,month,day):
 
181
  with gr.Column():
182
  btn = gr.Button("Show Results")
183
  gr.Markdown("## Dynamic prediction")
184
+ gr.Markdown("Select a weekday before today and it will predict the close price of S&P 500 at your date.")
185
  with gr.Row():
186
  with gr.Column():
187
+ date_input = gr.Textbox(label="Select Date (DD/MM/YYYY)")
188
  prediction = gr.Textbox(label="Prediction")
189
  with gr.Column():
190
  true_val = gr.Textbox("Real close price")