Hasan Iqbal
commited on
Commit
•
cae214c
1
Parent(s):
e3aed5f
Looking into streamlit
Browse files- README.md +1 -1
- requirements.txt +17 -0
- src/openfactcheck/app/app.py +23 -31
README.md
CHANGED
@@ -3,7 +3,7 @@ title: OpenFactCheck
|
|
3 |
emoji: ✅
|
4 |
colorFrom: green
|
5 |
colorTo: purple
|
6 |
-
sdk:
|
7 |
app_file: src/openfactcheck/app/app.py
|
8 |
pinned: false
|
9 |
-->
|
|
|
3 |
emoji: ✅
|
4 |
colorFrom: green
|
5 |
colorTo: purple
|
6 |
+
sdk: streamlit
|
7 |
app_file: src/openfactcheck/app/app.py
|
8 |
pinned: false
|
9 |
-->
|
requirements.txt
CHANGED
@@ -2,6 +2,7 @@ aiofiles
|
|
2 |
aiohttp
|
3 |
aiosignal
|
4 |
alabaster
|
|
|
5 |
annotated-types
|
6 |
anyio
|
7 |
arrow
|
@@ -15,6 +16,7 @@ bibtexparser
|
|
15 |
blinker
|
16 |
blis
|
17 |
bs4
|
|
|
18 |
catalogue
|
19 |
certifi
|
20 |
charset-normalizer
|
@@ -44,6 +46,8 @@ fonttools
|
|
44 |
free-proxy
|
45 |
frozenlist
|
46 |
fsspec
|
|
|
|
|
47 |
gradio
|
48 |
gradio_client
|
49 |
h11
|
@@ -58,6 +62,8 @@ itsdangerous
|
|
58 |
Jinja2
|
59 |
joblib
|
60 |
jsonlines
|
|
|
|
|
61 |
kiwisolver
|
62 |
langcodes
|
63 |
language_data
|
@@ -81,10 +87,12 @@ packaging
|
|
81 |
pandas
|
82 |
pillow
|
83 |
preshed
|
|
|
84 |
pyarrow
|
85 |
pyarrow-hotfix
|
86 |
pydantic
|
87 |
pydantic_core
|
|
|
88 |
pydub
|
89 |
Pygments
|
90 |
pyparsing
|
@@ -94,9 +102,11 @@ python-dotenv
|
|
94 |
python-multipart
|
95 |
pytz
|
96 |
PyYAML
|
|
|
97 |
regex
|
98 |
requests
|
99 |
rich
|
|
|
100 |
ruff
|
101 |
safetensors
|
102 |
scholarly
|
@@ -108,6 +118,7 @@ sentence-transformers
|
|
108 |
shellingham
|
109 |
six
|
110 |
smart-open
|
|
|
111 |
sniffio
|
112 |
snowballstemmer
|
113 |
sortedcontainers
|
@@ -126,14 +137,20 @@ sphinxcontrib-qthelp
|
|
126 |
sphinxcontrib-serializinghtml
|
127 |
srsly
|
128 |
starlette
|
|
|
|
|
129 |
sympy
|
|
|
130 |
thinc
|
131 |
threadpoolctl
|
132 |
tokenizers
|
|
|
133 |
tomlkit
|
|
|
134 |
torch
|
135 |
torchaudio
|
136 |
torchvision
|
|
|
137 |
tqdm
|
138 |
transformers
|
139 |
trio
|
|
|
2 |
aiohttp
|
3 |
aiosignal
|
4 |
alabaster
|
5 |
+
altair
|
6 |
annotated-types
|
7 |
anyio
|
8 |
arrow
|
|
|
16 |
blinker
|
17 |
blis
|
18 |
bs4
|
19 |
+
cachetools
|
20 |
catalogue
|
21 |
certifi
|
22 |
charset-normalizer
|
|
|
46 |
free-proxy
|
47 |
frozenlist
|
48 |
fsspec
|
49 |
+
gitdb
|
50 |
+
GitPython
|
51 |
gradio
|
52 |
gradio_client
|
53 |
h11
|
|
|
62 |
Jinja2
|
63 |
joblib
|
64 |
jsonlines
|
65 |
+
jsonschema
|
66 |
+
jsonschema-specifications
|
67 |
kiwisolver
|
68 |
langcodes
|
69 |
language_data
|
|
|
87 |
pandas
|
88 |
pillow
|
89 |
preshed
|
90 |
+
protobuf
|
91 |
pyarrow
|
92 |
pyarrow-hotfix
|
93 |
pydantic
|
94 |
pydantic_core
|
95 |
+
pydeck
|
96 |
pydub
|
97 |
Pygments
|
98 |
pyparsing
|
|
|
102 |
python-multipart
|
103 |
pytz
|
104 |
PyYAML
|
105 |
+
referencing
|
106 |
regex
|
107 |
requests
|
108 |
rich
|
109 |
+
rpds-py
|
110 |
ruff
|
111 |
safetensors
|
112 |
scholarly
|
|
|
118 |
shellingham
|
119 |
six
|
120 |
smart-open
|
121 |
+
smmap
|
122 |
sniffio
|
123 |
snowballstemmer
|
124 |
sortedcontainers
|
|
|
137 |
sphinxcontrib-serializinghtml
|
138 |
srsly
|
139 |
starlette
|
140 |
+
streamlit
|
141 |
+
streamlit-option-menu
|
142 |
sympy
|
143 |
+
tenacity
|
144 |
thinc
|
145 |
threadpoolctl
|
146 |
tokenizers
|
147 |
+
toml
|
148 |
tomlkit
|
149 |
+
toolz
|
150 |
torch
|
151 |
torchaudio
|
152 |
torchvision
|
153 |
+
tornado
|
154 |
tqdm
|
155 |
transformers
|
156 |
trio
|
src/openfactcheck/app/app.py
CHANGED
@@ -1,37 +1,29 @@
|
|
1 |
-
import
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
name (str): The name of the person to greet.
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
if (url.searchParams.get('__theme') !== 'light') {
|
20 |
-
url.searchParams.set('__theme', 'light');
|
21 |
-
window.location.href = url.href;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
"""
|
25 |
-
|
26 |
-
with gr.Blocks(js=js_func) as demo:
|
27 |
-
gr.Interface(
|
28 |
-
fn=greet, # Function to call
|
29 |
-
inputs=gr.Textbox(placeholder="Enter your name here...", label="Name"), # Input component
|
30 |
-
outputs="text", # Output component type
|
31 |
-
title="Hello World App", # Title of the app
|
32 |
-
description="A simple Gradio app that greets you." # Description of the app
|
33 |
-
)
|
34 |
-
|
35 |
-
# Run the interface
|
36 |
if __name__ == "__main__":
|
37 |
-
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from streamlit_option_menu import option_menu
|
3 |
|
4 |
+
class App:
|
5 |
+
def __init__(self):
|
6 |
+
pass
|
7 |
|
8 |
+
def run(self):
|
|
|
9 |
|
10 |
+
# Set up Dashboard
|
11 |
+
st.set_page_config(page_title="OpenFactCheck Dashboard",
|
12 |
+
page_icon=":bar_chart:",
|
13 |
+
layout="wide")
|
14 |
+
|
15 |
+
# Title
|
16 |
+
st.markdown("<h1 style='text-align: center;'>OpenFactCheck Dashboard</h1>", unsafe_allow_html=True)
|
17 |
+
st.markdown("<h5 style='text-align: center;'>An Open-source Factuality Evaluation Demo for LLMs</h3>", unsafe_allow_html=True)
|
18 |
|
19 |
+
# Selection Menu
|
20 |
+
selected = option_menu(None, ["Evaluate LLM Response", "Evaluate LLM", "Evaluate FactChecker", "Leaderboards", "About"],
|
21 |
+
icons=['card-checklist', 'check-square', "check2-all", "trophy", "info-circle"],
|
22 |
+
menu_icon="cast",
|
23 |
+
default_index=0,
|
24 |
+
orientation="horizontal"
|
25 |
+
)
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
if __name__ == "__main__":
|
28 |
+
app = App()
|
29 |
+
app.run()
|