Spaces:
Runtime error
Runtime error
Upload with huggingface_hub
Browse files- DESCRIPTION.md +1 -0
- README.md +1 -1
- app.py +0 -11
DESCRIPTION.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
A simple dashboard showing pypi stats for python libraries. Updates on load, and has no buttons!
|
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
|
| 2 |
---
|
| 3 |
title: timeseries-forecasting-with-prophet
|
| 4 |
-
emoji:
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
|
|
|
| 1 |
|
| 2 |
---
|
| 3 |
title: timeseries-forecasting-with-prophet
|
| 4 |
+
emoji: π₯
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
app.py
CHANGED
|
@@ -1,6 +1,3 @@
|
|
| 1 |
-
# URL: https://huggingface.co/spaces/gradio/timeseries-forecasting-with-prophet
|
| 2 |
-
# DESCRIPTION: A simple dashboard showing pypi stats for python libraries. Updates on load, and has no buttons!
|
| 3 |
-
# imports
|
| 4 |
import gradio as gr
|
| 5 |
import pypistats
|
| 6 |
from datetime import date
|
|
@@ -9,7 +6,6 @@ import pandas as pd
|
|
| 9 |
from prophet import Prophet
|
| 10 |
pd.options.plotting.backend = "plotly"
|
| 11 |
|
| 12 |
-
# defining the core fn
|
| 13 |
def get_forecast(lib, time):
|
| 14 |
|
| 15 |
data = pypistats.overall(lib, total=True, format="pandas")
|
|
@@ -27,26 +23,19 @@ def get_forecast(lib, time):
|
|
| 27 |
fig1 = m.plot(forecast)
|
| 28 |
return fig1
|
| 29 |
|
| 30 |
-
# starting a block
|
| 31 |
with gr.Blocks() as demo:
|
| 32 |
-
# defining text on the page
|
| 33 |
gr.Markdown(
|
| 34 |
"""
|
| 35 |
**Pypi Download Stats π with Prophet Forecasting**: see live download stats for popular open-source libraries π€ along with a 3 month forecast using Prophet. The [ source code for this Gradio demo is here](https://huggingface.co/spaces/gradio/timeseries-forecasting-with-prophet/blob/main/app.py).
|
| 36 |
""")
|
| 37 |
-
# defining layout
|
| 38 |
with gr.Row():
|
| 39 |
-
# defining inputs
|
| 40 |
lib = gr.Dropdown(["pandas", "scikit-learn", "torch", "prophet"], label="Library", value="pandas")
|
| 41 |
time = gr.Dropdown(["3 months", "6 months", "9 months", "12 months"], label="Downloads over the last...", value="12 months")
|
| 42 |
|
| 43 |
-
# defining output
|
| 44 |
plt = gr.Plot()
|
| 45 |
|
| 46 |
-
# defining when the output will update, and core fn will run: when either input is changed, or demo loads
|
| 47 |
lib.change(get_forecast, [lib, time], plt, queue=False)
|
| 48 |
time.change(get_forecast, [lib, time], plt, queue=False)
|
| 49 |
demo.load(get_forecast, [lib, time], plt, queue=False)
|
| 50 |
|
| 51 |
-
# launch
|
| 52 |
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pypistats
|
| 3 |
from datetime import date
|
|
|
|
| 6 |
from prophet import Prophet
|
| 7 |
pd.options.plotting.backend = "plotly"
|
| 8 |
|
|
|
|
| 9 |
def get_forecast(lib, time):
|
| 10 |
|
| 11 |
data = pypistats.overall(lib, total=True, format="pandas")
|
|
|
|
| 23 |
fig1 = m.plot(forecast)
|
| 24 |
return fig1
|
| 25 |
|
|
|
|
| 26 |
with gr.Blocks() as demo:
|
|
|
|
| 27 |
gr.Markdown(
|
| 28 |
"""
|
| 29 |
**Pypi Download Stats π with Prophet Forecasting**: see live download stats for popular open-source libraries π€ along with a 3 month forecast using Prophet. The [ source code for this Gradio demo is here](https://huggingface.co/spaces/gradio/timeseries-forecasting-with-prophet/blob/main/app.py).
|
| 30 |
""")
|
|
|
|
| 31 |
with gr.Row():
|
|
|
|
| 32 |
lib = gr.Dropdown(["pandas", "scikit-learn", "torch", "prophet"], label="Library", value="pandas")
|
| 33 |
time = gr.Dropdown(["3 months", "6 months", "9 months", "12 months"], label="Downloads over the last...", value="12 months")
|
| 34 |
|
|
|
|
| 35 |
plt = gr.Plot()
|
| 36 |
|
|
|
|
| 37 |
lib.change(get_forecast, [lib, time], plt, queue=False)
|
| 38 |
time.change(get_forecast, [lib, time], plt, queue=False)
|
| 39 |
demo.load(get_forecast, [lib, time], plt, queue=False)
|
| 40 |
|
|
|
|
| 41 |
demo.launch()
|