Spaces:
Runtime error
Runtime error
alex n
commited on
Commit
·
604a5b9
1
Parent(s):
32253ac
fixed bug with wrong data types being shown
Browse files
app.py
CHANGED
@@ -154,13 +154,13 @@ def get_validator_data() -> pd.DataFrame:
|
|
154 |
print(f"Error connecting to {axon_endpoint}: {e}")
|
155 |
|
156 |
try:
|
157 |
-
last_update = metagraph.last_update[uid]
|
158 |
validator_info['Updated'] = current_block - last_update
|
159 |
except Exception as e:
|
160 |
print(f"Error getting Updated for UID {uid}: {str(e)}")
|
161 |
|
162 |
try:
|
163 |
-
validator_info['VTrust'] = metagraph.validator_trust[uid]
|
164 |
except Exception as e:
|
165 |
print(f"Error getting VTrust for UID {uid}: {str(e)}")
|
166 |
|
@@ -170,6 +170,7 @@ def get_validator_data() -> pd.DataFrame:
|
|
170 |
results.append(validator_info)
|
171 |
|
172 |
df = pd.DataFrame(results)
|
|
|
173 |
return df.sort_values('Step', ascending=False)[['Name', 'UID', 'Axon', 'API', 'Step', 'Recent Bits', 'Updated', 'VTrust']]
|
174 |
|
175 |
# Create the Gradio interface
|
|
|
154 |
print(f"Error connecting to {axon_endpoint}: {e}")
|
155 |
|
156 |
try:
|
157 |
+
last_update = int(metagraph.last_update[uid])
|
158 |
validator_info['Updated'] = current_block - last_update
|
159 |
except Exception as e:
|
160 |
print(f"Error getting Updated for UID {uid}: {str(e)}")
|
161 |
|
162 |
try:
|
163 |
+
validator_info['VTrust'] = float(metagraph.validator_trust[uid])
|
164 |
except Exception as e:
|
165 |
print(f"Error getting VTrust for UID {uid}: {str(e)}")
|
166 |
|
|
|
170 |
results.append(validator_info)
|
171 |
|
172 |
df = pd.DataFrame(results)
|
173 |
+
df['VTrust'] = df['VTrust'].round(4)
|
174 |
return df.sort_values('Step', ascending=False)[['Name', 'UID', 'Axon', 'API', 'Step', 'Recent Bits', 'Updated', 'VTrust']]
|
175 |
|
176 |
# Create the Gradio interface
|