CultriX commited on
Commit
20b3456
β€’
1 Parent(s): e9dbd6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  import pandas as pd
3
- from huggingface_hub import HfApi, ModelCard
4
  from huggingface_hub.utils import RepositoryNotFoundError, RevisionNotFoundError
5
  import re
6
  from io import StringIO
@@ -19,6 +19,9 @@ def cached_model_info(_api, model):
19
  except (RepositoryNotFoundError, RevisionNotFoundError) as e:
20
  st.error(f"Error fetching model info for {model}: {str(e)}")
21
  return None
 
 
 
22
 
23
  @st.cache_data
24
  def get_model_info(df):
@@ -96,11 +99,23 @@ def fetch_merge_configs(df):
96
  except Exception as e:
97
  st.error(f"Error while fetching merge configs: {str(e)}")
98
 
 
 
 
 
 
 
 
 
 
99
  def main():
100
  """Main function to set up the Streamlit app and display the leaderboard."""
101
  st.set_page_config(page_title="YALL - Yet Another LLM Leaderboard", layout="wide")
102
  st.title("πŸ† YALL - Yet Another LLM Leaderboard")
103
  st.markdown("Leaderboard made with 🧐 [LLM AutoEval](https://github.com/mlabonne/llm-autoeval) using [Nous](https://huggingface.co/NousResearch) benchmark suite.")
 
 
 
104
  content = create_yall()
105
  tab1, tab2 = st.tabs(["πŸ† Leaderboard", "πŸ“ About"])
106
 
 
1
  import streamlit as st
2
  import pandas as pd
3
+ from huggingface_hub import HfApi, ModelCard, login
4
  from huggingface_hub.utils import RepositoryNotFoundError, RevisionNotFoundError
5
  import re
6
  from io import StringIO
 
19
  except (RepositoryNotFoundError, RevisionNotFoundError) as e:
20
  st.error(f"Error fetching model info for {model}: {str(e)}")
21
  return None
22
+ except Exception as e:
23
+ st.error(f"Unexpected error fetching model info for {model}: {str(e)}")
24
+ return None
25
 
26
  @st.cache_data
27
  def get_model_info(df):
 
99
  except Exception as e:
100
  st.error(f"Error while fetching merge configs: {str(e)}")
101
 
102
+ def authenticate_hf():
103
+ """Authenticate with the Hugging Face API."""
104
+ token = st.text_input("Enter your Hugging Face API token", type="password")
105
+ if token:
106
+ login(token=token)
107
+ st.success("Authenticated successfully")
108
+ else:
109
+ st.warning("You need to enter a Hugging Face API token to access private or gated models")
110
+
111
  def main():
112
  """Main function to set up the Streamlit app and display the leaderboard."""
113
  st.set_page_config(page_title="YALL - Yet Another LLM Leaderboard", layout="wide")
114
  st.title("πŸ† YALL - Yet Another LLM Leaderboard")
115
  st.markdown("Leaderboard made with 🧐 [LLM AutoEval](https://github.com/mlabonne/llm-autoeval) using [Nous](https://huggingface.co/NousResearch) benchmark suite.")
116
+
117
+ authenticate_hf()
118
+
119
  content = create_yall()
120
  tab1, tab2 = st.tabs(["πŸ† Leaderboard", "πŸ“ About"])
121