Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
hub, discord, total exp + levels update on timer for hub activity
Browse files
app.py
CHANGED
@@ -143,6 +143,25 @@ def update_hub_stats():
|
|
143 |
global_df.loc[index, 'discussions'] = discussions
|
144 |
global_df.loc[index, 'papers'] = papers
|
145 |
global_df.loc[index, 'upvotes'] = upvotes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
except Exception as e:
|
147 |
print(f"{e} error updating the dataframe")
|
148 |
|
|
|
143 |
global_df.loc[index, 'discussions'] = discussions
|
144 |
global_df.loc[index, 'papers'] = papers
|
145 |
global_df.loc[index, 'upvotes'] = upvotes
|
146 |
+
|
147 |
+
total_hub_activity = likes + models + datasets + spaces + discussions + papers + upvotes
|
148 |
+
total_hub_exp = total_hub_activity * 2
|
149 |
+
total_hub_exp_string = f"L" + str(total_hub_exp) + f"L"
|
150 |
+
|
151 |
+
# hub exp
|
152 |
+
global_df.loc[index, 'hub_exp'] = the_string
|
153 |
+
|
154 |
+
# total exp (discord + hub)
|
155 |
+
discord_exp = row['discord_exp']
|
156 |
+
discord_exp_int = discord_exp.str.strip('L').astype(int)
|
157 |
+
total_exp = discord_exp_int + total_hub_exp
|
158 |
+
total_exp_string = f"L" + str(total_exp) + f"L"
|
159 |
+
global_df.loc[index, 'total_exp'] = total_exp_string
|
160 |
+
|
161 |
+
# level
|
162 |
+
level = calculate_level(total_exp)
|
163 |
+
global_df.loc[index, 'level'] = level
|
164 |
+
|
165 |
except Exception as e:
|
166 |
print(f"{e} error updating the dataframe")
|
167 |
|