from get_forecast import get_forecast import gradio as gr with gr.Blocks() as demo: gr.Markdown( """ # AB InBev Data Science Challenge Welcome to the AB InBev Data Science Challenge demo! This interactive tool is designed to help you forecast the **SOM** and **Volume** series, and analyze their price sensitivity. ## How to use this demo? Using this demo is simple and straightforward. Just follow these steps: 1. Select the series you want to forecast from the dropdown menu. The valid options are **SOM** and **Volume**. 2. Specify the number of months ahead for your forecast. 3. Choose the desired price variation compared to the previous year. A value of 0 indicates that the future price values will be the same as the previous year. That's it! You're ready to explore and analyze the forecasted series. Enjoy! """) with gr.Row(): serie = gr.Dropdown(choices = ['SOM', 'Volumen'], value = 'SOM', label = 'Serie', info = 'Choose the serie to forecast') periods = gr.Slider(minimum = 1, maximum = 12, step = 1, value = 3, label = 'Months') percent_change = gr.Slider(minimum = -100, maximum = 100, step = 5, value = -5, label = '% Change vs Last Year') plot = gr.Plot() serie.change(get_forecast, [serie, periods, percent_change], plot, queue=False) periods.change(get_forecast, [serie, periods, percent_change], plot, queue=False) percent_change.change(get_forecast, [serie, periods, percent_change], plot, queue=False) plot.change(get_forecast, [serie, periods, percent_change], plot, queue=False) demo.load(get_forecast, [serie, periods, percent_change], plot, queue=False) demo.launch(debug = False)