Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def split_multi_users(dfs):
|
|
18 |
return df
|
19 |
|
20 |
def plot_now():
|
21 |
-
dfs = pd.read_csv("hf://spaces/
|
22 |
dfs = dfs.drop(columns=["Unnamed: 0"])
|
23 |
dfs = dfs.fillna("FREE")
|
24 |
dfs_plot = split_multi_users(dfs)
|
@@ -38,14 +38,14 @@ def plot_now():
|
|
38 |
return fig, dfs
|
39 |
|
40 |
def plot_history():
|
41 |
-
dfh = pd.read_pickle("hf://spaces/
|
42 |
dfh = dfh.fillna("FREE")
|
43 |
dfh = split_multi_users(dfh)
|
44 |
dfh = dfh[["polling_timestamp", "username", "count"]]
|
45 |
dfh = dfh.groupby(["polling_timestamp", "username"]).sum()
|
46 |
dfh = dfh.reset_index()
|
47 |
dfh = dfh.sort_values(by=["polling_timestamp", "count"], ascending=False)
|
48 |
-
fig = px.area(dfh, x="polling_timestamp", y="count", color='username', color_discrete_map={"FREE": "black",}, markers=True)
|
49 |
return fig, dfh
|
50 |
|
51 |
|
@@ -73,4 +73,4 @@ demo = gr.Interface(
|
|
73 |
)
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
-
demo.launch(debug=
|
|
|
18 |
return df
|
19 |
|
20 |
def plot_now():
|
21 |
+
dfs = pd.read_csv("hf://spaces/pluslab/PLUS_Lab_GPUs/gpus.csv")
|
22 |
dfs = dfs.drop(columns=["Unnamed: 0"])
|
23 |
dfs = dfs.fillna("FREE")
|
24 |
dfs_plot = split_multi_users(dfs)
|
|
|
38 |
return fig, dfs
|
39 |
|
40 |
def plot_history():
|
41 |
+
dfh = pd.read_pickle("hf://spaces/pluslab/PLUS_Lab_GPUs/history.pkl.gz", )
|
42 |
dfh = dfh.fillna("FREE")
|
43 |
dfh = split_multi_users(dfh)
|
44 |
dfh = dfh[["polling_timestamp", "username", "count"]]
|
45 |
dfh = dfh.groupby(["polling_timestamp", "username"]).sum()
|
46 |
dfh = dfh.reset_index()
|
47 |
dfh = dfh.sort_values(by=["polling_timestamp", "count"], ascending=False)
|
48 |
+
fig = px.area(dfh, x="polling_timestamp", y="count", color='username', color_discrete_map={"FREE": "black",}, markers=True, line_shape='spline',)
|
49 |
return fig, dfh
|
50 |
|
51 |
|
|
|
73 |
)
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
+
demo.launch(debug=False)
|