Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ import models
|
|
4 |
def main():
|
5 |
st.set_page_config(layout="wide", page_title="Review Toxicity Checker")
|
6 |
st.title('Review Toxicity Checker')
|
7 |
-
print(st.secrets["default_hf_api"])
|
8 |
left_col, right_col = st.columns(2)
|
9 |
|
10 |
content = left_col.empty()
|
@@ -14,7 +13,7 @@ def main():
|
|
14 |
"Select a model option:",
|
15 |
["stabilityai/stablelm-zephyr-3b", "mistralai/Mistral-7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2"]
|
16 |
)
|
17 |
-
hf_api_key = st.text_input('HF API Key\nhttps://huggingface.co/settings/tokens')
|
18 |
color = st.color_picker('Highlight Color', '#F44336')
|
19 |
|
20 |
with right_col:
|
@@ -28,11 +27,11 @@ def main():
|
|
28 |
with right_col2:
|
29 |
clear = st.button('Clear Text')
|
30 |
if check:
|
|
|
31 |
with st.spinner('Processing review...'):
|
32 |
revision = models.revise_review(input_text, hf_api_key, model_id, color)
|
33 |
try:
|
34 |
with right_col:
|
35 |
-
print(revision)
|
36 |
st.markdown(f""" <div style="border:1px solid white; padding:10px; height:500px; overflow:auto; border-radius:7px;"> {revision['data']['revision']} </div> """, unsafe_allow_html=True)
|
37 |
num_revised = int(revision['data']['revised_sentences'])/int(revision['data']['sentence_count'])
|
38 |
left_col2, right_col2 = st.columns([1,2])
|
|
|
4 |
def main():
|
5 |
st.set_page_config(layout="wide", page_title="Review Toxicity Checker")
|
6 |
st.title('Review Toxicity Checker')
|
|
|
7 |
left_col, right_col = st.columns(2)
|
8 |
|
9 |
content = left_col.empty()
|
|
|
13 |
"Select a model option:",
|
14 |
["stabilityai/stablelm-zephyr-3b", "mistralai/Mistral-7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2"]
|
15 |
)
|
16 |
+
#hf_api_key = st.text_input('HF API Key\nhttps://huggingface.co/settings/tokens')
|
17 |
color = st.color_picker('Highlight Color', '#F44336')
|
18 |
|
19 |
with right_col:
|
|
|
27 |
with right_col2:
|
28 |
clear = st.button('Clear Text')
|
29 |
if check:
|
30 |
+
hf_api_key = st.secrets["default_hf_api"]
|
31 |
with st.spinner('Processing review...'):
|
32 |
revision = models.revise_review(input_text, hf_api_key, model_id, color)
|
33 |
try:
|
34 |
with right_col:
|
|
|
35 |
st.markdown(f""" <div style="border:1px solid white; padding:10px; height:500px; overflow:auto; border-radius:7px;"> {revision['data']['revision']} </div> """, unsafe_allow_html=True)
|
36 |
num_revised = int(revision['data']['revised_sentences'])/int(revision['data']['sentence_count'])
|
37 |
left_col2, right_col2 = st.columns([1,2])
|