Omar Sanseviero commited on
Commit
476d25a
·
1 Parent(s): bef0c51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -5,6 +5,7 @@ from tqdm.auto import tqdm
5
  import streamlit as st
6
  from huggingface_hub import HfApi, hf_hub_download
7
  from huggingface_hub.repocard import metadata_load
 
8
 
9
  def make_clickable(model_name):
10
  link = "https://huggingface.co/" + model_name
@@ -64,4 +65,20 @@ dataframe["Model"] = dataframe["Model"].apply(make_clickable)
64
  dataframe = dataframe.sort_values(by=['Accuracy'], ascending=False)
65
  table_html = dataframe.to_html(escape=False)
66
  table_html = table_html.replace("<th>", '<th align="left">') # left-align the headers
67
- st.write(table_html, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  import streamlit as st
6
  from huggingface_hub import HfApi, hf_hub_download
7
  from huggingface_hub.repocard import metadata_load
8
+ import streamlit.components.v1 as components
9
 
10
  def make_clickable(model_name):
11
  link = "https://huggingface.co/" + model_name
 
65
  dataframe = dataframe.sort_values(by=['Accuracy'], ascending=False)
66
  table_html = dataframe.to_html(escape=False)
67
  table_html = table_html.replace("<th>", '<th align="left">') # left-align the headers
68
+ st.write(table_html, unsafe_allow_html=True)
69
+
70
+ embed_gradio = components.html(
71
+ """
72
+ <head>
73
+ <link rel="stylesheet" href="https://gradio.s3-us-west-2.amazonaws.com/2.6.2/static/bundle.css">
74
+ </head>
75
+ <body>
76
+ <div id="target"></div>
77
+ <script src="https://gradio.s3-us-west-2.amazonaws.com/2.6.2/static/bundle.js"></script>
78
+ <script>
79
+ launchGradioFromSpaces("osanseviero/llama-classifiers", "#target")
80
+ </script>
81
+ </body>
82
+ """,
83
+ height=600,
84
+ )