Spaces:
Running
Running
anakin87
commited on
Commit
·
46a17f1
1
Parent(s):
d3c6528
little improvements to webapp and more statements
Browse files- Rock_fact_checker.py +6 -7
- data/statements.txt +13 -1
Rock_fact_checker.py
CHANGED
@@ -59,15 +59,14 @@ def main():
|
|
59 |
st.session_state.random_statement_requested = True
|
60 |
# Re-runs the script setting the random statement as the textbox value
|
61 |
# Unfortunately necessary as the Random statement button is _below_ the textbox
|
62 |
-
# Adapted for Streamlit>=1.12
|
63 |
if hasattr(st, "scriptrunner"):
|
64 |
raise st.scriptrunner.script_runner.RerunException(
|
65 |
-
st.scriptrunner.script_requests.RerunData(
|
66 |
-
)
|
67 |
-
else:
|
68 |
-
raise st.runtime.scriptrunner.script_runner.RerunException(
|
69 |
-
st.runtime.scriptrunner.script_requests.RerunData("")
|
70 |
)
|
|
|
|
|
|
|
71 |
else:
|
72 |
st.session_state.random_statement_requested = False
|
73 |
run_query = (
|
@@ -82,7 +81,7 @@ def main():
|
|
82 |
with st.spinner("🧠 Performing neural search on documents..."):
|
83 |
try:
|
84 |
st.session_state.results = query(statement, RETRIEVER_TOP_K)
|
85 |
-
print(statement)
|
86 |
time_end = time.time()
|
87 |
print(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()))
|
88 |
print(f"elapsed time: {time_end - time_start}")
|
|
|
59 |
st.session_state.random_statement_requested = True
|
60 |
# Re-runs the script setting the random statement as the textbox value
|
61 |
# Unfortunately necessary as the Random statement button is _below_ the textbox
|
62 |
+
# Adapted for Streamlit>=1.12.0
|
63 |
if hasattr(st, "scriptrunner"):
|
64 |
raise st.scriptrunner.script_runner.RerunException(
|
65 |
+
st.scriptrunner.script_requests.RerunData(widget_states=None)
|
|
|
|
|
|
|
|
|
66 |
)
|
67 |
+
raise st.runtime.scriptrunner.script_runner.RerunException(
|
68 |
+
st.runtime.scriptrunner.script_requests.RerunData(widget_states=None)
|
69 |
+
)
|
70 |
else:
|
71 |
st.session_state.random_statement_requested = False
|
72 |
run_query = (
|
|
|
81 |
with st.spinner("🧠 Performing neural search on documents..."):
|
82 |
try:
|
83 |
st.session_state.results = query(statement, RETRIEVER_TOP_K)
|
84 |
+
print(f"S: {statement}")
|
85 |
time_end = time.time()
|
86 |
print(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()))
|
87 |
print(f"elapsed time: {time_end - time_start}")
|
data/statements.txt
CHANGED
@@ -56,4 +56,16 @@ Some Slayer songs involve murder
|
|
56 |
Incubus formation includes a DJ
|
57 |
Blur is a nu metal band
|
58 |
Keith Emerson committed suicide
|
59 |
-
Bono Vox loves pets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
Incubus formation includes a DJ
|
57 |
Blur is a nu metal band
|
58 |
Keith Emerson committed suicide
|
59 |
+
Bono Vox loves pets
|
60 |
+
Van Halen are still active
|
61 |
+
The Beatles were American
|
62 |
+
Jim Morrison was the singer of the Door's
|
63 |
+
Jimi Hendrix played the piano
|
64 |
+
Jimi Hendrix was not successful
|
65 |
+
Stairway to heaven is a prominent song by Led Zeppelin
|
66 |
+
The Beatles were 4
|
67 |
+
King Crimson played progressive rock
|
68 |
+
Rick Wakeman was a member of Yes and no other band
|
69 |
+
The Beatles' first album was released in 1963
|
70 |
+
Faith No More have released 5 albums
|
71 |
+
Angus brothers play in AC DC
|