Spaces:
Runtime error
Runtime error
from get_forecast import get_forecast | |
import gradio as gr | |
with gr.Blocks() as demo: | |
gr.Markdown( | |
""" | |
# AB InBev Data Science Challenge | |
This is a demo built for AB InBev company to forecast **SOM** and **Volume** series. This demo allows the user to analyze the price sensibility of the mentioned series. Enjoy! | |
## How do you use this demo? | |
Using this demo is easy! Simply follow the next steps: | |
1. Select a Serie to forecast from the dropdown (valid values: SOM and Volumen) | |
2. Choose how many months ahead do you wish your forecast to predict | |
3. Pick the price variation vs last year you want to analyze. Setting this value to 0 means the future price values are exactly the same as the last year. | |
""") | |
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) |