Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,18 @@
|
|
1 |
import requests
|
2 |
import streamlit as st
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
def fetch_readme_content():
|
6 |
url = "https://raw.githubusercontent.com/SAILResearch/awesome-foundation-model-leaderboards/main/README.md"
|
@@ -11,7 +23,6 @@ def fetch_readme_content():
|
|
11 |
st.error("Failed to fetch README.md content from GitHub.")
|
12 |
return ""
|
13 |
|
14 |
-
|
15 |
class SearchApplication:
|
16 |
def __init__(self):
|
17 |
self.title = "Foundation Model Leaderboard Search"
|
@@ -32,6 +43,7 @@ class SearchApplication:
|
|
32 |
st.write("#")
|
33 |
|
34 |
self.show_search_results()
|
|
|
35 |
|
36 |
def set_page_config(self):
|
37 |
st.set_page_config(
|
@@ -40,7 +52,6 @@ class SearchApplication:
|
|
40 |
layout="centered",
|
41 |
)
|
42 |
|
43 |
-
|
44 |
def show_search_results(self):
|
45 |
if self.query or self.search_button:
|
46 |
st.write("#")
|
@@ -63,6 +74,14 @@ class SearchApplication:
|
|
63 |
else:
|
64 |
st.write("No matches found.")
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
if __name__ == "__main__":
|
68 |
SearchApplication()
|
|
|
1 |
import requests
|
2 |
import streamlit as st
|
3 |
|
4 |
+
# Constants for citation information
|
5 |
+
CITATION_BUTTON_LABEL = "📙 Citation"
|
6 |
+
CITATION_BUTTON_TEXT = """
|
7 |
+
If you use this resource, please cite it as:
|
8 |
+
|
9 |
+
@misc{awesome-leaderboards,
|
10 |
+
author = {SAIL Research},
|
11 |
+
title = {Awesome Foundation Model Leaderboards},
|
12 |
+
year = {2023},
|
13 |
+
howpublished = {\\url{https://github.com/SAILResearch/awesome-foundation-model-leaderboards}},
|
14 |
+
}
|
15 |
+
"""
|
16 |
|
17 |
def fetch_readme_content():
|
18 |
url = "https://raw.githubusercontent.com/SAILResearch/awesome-foundation-model-leaderboards/main/README.md"
|
|
|
23 |
st.error("Failed to fetch README.md content from GitHub.")
|
24 |
return ""
|
25 |
|
|
|
26 |
class SearchApplication:
|
27 |
def __init__(self):
|
28 |
self.title = "Foundation Model Leaderboard Search"
|
|
|
43 |
st.write("#")
|
44 |
|
45 |
self.show_search_results()
|
46 |
+
self.show_citation_panel() # Add the citation panel here
|
47 |
|
48 |
def set_page_config(self):
|
49 |
st.set_page_config(
|
|
|
52 |
layout="centered",
|
53 |
)
|
54 |
|
|
|
55 |
def show_search_results(self):
|
56 |
if self.query or self.search_button:
|
57 |
st.write("#")
|
|
|
74 |
else:
|
75 |
st.write("No matches found.")
|
76 |
|
77 |
+
def show_citation_panel(self):
|
78 |
+
with st.expander(CITATION_BUTTON_LABEL, expanded=True):
|
79 |
+
st.text_area(
|
80 |
+
label="",
|
81 |
+
value=CITATION_BUTTON_TEXT,
|
82 |
+
height=100,
|
83 |
+
help="Copy the citation text",
|
84 |
+
)
|
85 |
|
86 |
if __name__ == "__main__":
|
87 |
SearchApplication()
|