Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,18 +35,21 @@ def convert_markdown_table_to_dataframe(md_content):
|
|
35 |
|
36 |
return df
|
37 |
|
38 |
-
|
|
|
39 |
api = HfApi()
|
40 |
-
|
41 |
-
df['Tags'] = '' # Default value for Tags
|
42 |
for index, row in df.iterrows():
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
48 |
return df
|
49 |
|
|
|
50 |
def calculate_highest_combined_score(data, column):
|
51 |
# Ensure the column exists and has numeric data
|
52 |
if column not in data.columns or not pd.api.types.is_numeric_dtype(data[column]):
|
|
|
35 |
|
36 |
return df
|
37 |
|
38 |
+
@st.cache
|
39 |
+
def get_model_info(df):
|
40 |
api = HfApi()
|
41 |
+
|
|
|
42 |
for index, row in df.iterrows():
|
43 |
+
model_info = cached_model_info(api, row['Model'].strip())
|
44 |
+
if model_info:
|
45 |
+
df.loc[index, 'Likes'] = model_info.likes
|
46 |
+
df.loc[index, 'Tags'] = ', '.join(model_info.tags)
|
47 |
+
else:
|
48 |
+
df.loc[index, 'Likes'] = -1
|
49 |
+
df.loc[index, 'Tags'] = ''
|
50 |
return df
|
51 |
|
52 |
+
|
53 |
def calculate_highest_combined_score(data, column):
|
54 |
# Ensure the column exists and has numeric data
|
55 |
if column not in data.columns or not pd.api.types.is_numeric_dtype(data[column]):
|