pigieligi commited on
Commit
8abe042
·
1 Parent(s): eda58c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -79,6 +79,7 @@ def fetch_prediction_for_title(title):
79
 
80
 
81
  new_data = fetch_new_predictions()
 
82
 
83
  with gr.Blocks("soft") as demo:
84
  live = True
@@ -103,17 +104,18 @@ with gr.Blocks("soft") as demo:
103
  with gr.TabItem("Search a movie"):
104
  gr.Markdown("## Predict a revenue for a selected movie! You can type the title you want to search for and we'll see if we can predict how much it will earn.")
105
  with gr.Row():
106
- input_title = gr.Textbox(value = new_data[0])
107
  search_button = gr.Button(value="Search")
108
  with gr.Row():
109
  with gr.Column():
110
  with gr.Row():
111
- prediction_s = gr.Markdown(new_data[3])
112
- budget = gr.Markdown(f"#### Movie with budget")
113
  with gr.Row():
114
- overview = gr.Markdown("Overview of the movie")
 
 
115
  with gr.Column():
116
- image_search = gr.Image(new_data[6])
117
 
118
  search_button.click(fn = fetch_prediction_for_title, inputs = [input_title], outputs = [prediction_s, image_search, budget, overview])
119
  reload_button.click(fn = fetch_new_predictions, inputs=[], outputs=[title_0, title_1, title_2, prediction_0, prediction_1, prediction_2, image_0, image_1, image_2])
 
79
 
80
 
81
  new_data = fetch_new_predictions()
82
+ search_data = fetch_prediction_for_title(new_data[0][4:])
83
 
84
  with gr.Blocks("soft") as demo:
85
  live = True
 
104
  with gr.TabItem("Search a movie"):
105
  gr.Markdown("## Predict a revenue for a selected movie! You can type the title you want to search for and we'll see if we can predict how much it will earn.")
106
  with gr.Row():
107
+ input_title = gr.Textbox(value = new_data[0][4:])
108
  search_button = gr.Button(value="Search")
109
  with gr.Row():
110
  with gr.Column():
111
  with gr.Row():
112
+ prediction_s = gr.Markdown(search_data[0])
 
113
  with gr.Row():
114
+ budget = gr.Markdown(search_data[2])
115
+ with gr.Row():
116
+ overview = gr.Markdown(search_data[3])
117
  with gr.Column():
118
+ image_search = gr.Image(search_data[1])
119
 
120
  search_button.click(fn = fetch_prediction_for_title, inputs = [input_title], outputs = [prediction_s, image_search, budget, overview])
121
  reload_button.click(fn = fetch_new_predictions, inputs=[], outputs=[title_0, title_1, title_2, prediction_0, prediction_1, prediction_2, image_0, image_1, image_2])