Spaces:
Sleeping
Sleeping
A-Duss
commited on
Commit
•
3c7a691
1
Parent(s):
006f582
hf transfer enabled
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
from collections import OrderedDict
|
3 |
-
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "
|
4 |
|
5 |
import gradio as gr
|
6 |
from shitsu import ShitsuScorer
|
@@ -51,7 +51,7 @@ def get_score(user_text, language):
|
|
51 |
score = optimized_scorer.score(user_text, language)
|
52 |
formatted_score = f"{score:.4g}"
|
53 |
loaded_languages = optimized_scorer.get_loaded_languages()
|
54 |
-
display_loaded_languages = [('Currently loaded languages:', None)]
|
55 |
for language in loaded_languages:
|
56 |
display_loaded_languages.append((language_map[language], language))
|
57 |
display_loaded_languages.append((' ', None))
|
@@ -161,6 +161,8 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
161 |
"""This is a demo of [Shitsu text scorer](https://huggingface.co/lightblue/shitsu_text_scorer) for multiple languages, which scores text based on the amount of useful, textbook-like information in it.
|
162 |
|
163 |
It outputs a score generally between 0 and 1 but can exceed both of these bounds as it is a regressor.
|
|
|
|
|
164 |
"""
|
165 |
)
|
166 |
with gr.Row():
|
|
|
1 |
import os
|
2 |
from collections import OrderedDict
|
3 |
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
4 |
|
5 |
import gradio as gr
|
6 |
from shitsu import ShitsuScorer
|
|
|
51 |
score = optimized_scorer.score(user_text, language)
|
52 |
formatted_score = f"{score:.4g}"
|
53 |
loaded_languages = optimized_scorer.get_loaded_languages()
|
54 |
+
display_loaded_languages = [('Currently loaded languages: \n', None)]
|
55 |
for language in loaded_languages:
|
56 |
display_loaded_languages.append((language_map[language], language))
|
57 |
display_loaded_languages.append((' ', None))
|
|
|
161 |
"""This is a demo of [Shitsu text scorer](https://huggingface.co/lightblue/shitsu_text_scorer) for multiple languages, which scores text based on the amount of useful, textbook-like information in it.
|
162 |
|
163 |
It outputs a score generally between 0 and 1 but can exceed both of these bounds as it is a regressor.
|
164 |
+
|
165 |
+
⚠️ By default, the English version of the scorer is preloaded in memory. When using another language for the first time, beware extensive loading time.
|
166 |
"""
|
167 |
)
|
168 |
with gr.Row():
|