Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,11 @@ from transformers import pipeline
|
|
9 |
#
|
10 |
# model = load_model()
|
11 |
|
12 |
-
@st.cache_resource # кэширование
|
13 |
-
def load_model():
|
14 |
-
|
15 |
|
16 |
-
model = load_model()
|
17 |
|
18 |
def top_pct(preds, threshold=.95):
|
19 |
preds = sorted(preds, key=lambda x: -x["score"])
|
@@ -93,5 +93,5 @@ if query:
|
|
93 |
""", unsafe_allow_html=True)
|
94 |
# result = format_predictions(top_pct(model(query)[0]))
|
95 |
# result = query
|
96 |
-
result = model(query)[0]
|
97 |
st.write(result)
|
|
|
9 |
#
|
10 |
# model = load_model()
|
11 |
|
12 |
+
# @st.cache_resource # кэширование
|
13 |
+
# def load_model():
|
14 |
+
# return pipeline("sentiment-analysis") # скачивание модели
|
15 |
|
16 |
+
# model = load_model()
|
17 |
|
18 |
def top_pct(preds, threshold=.95):
|
19 |
preds = sorted(preds, key=lambda x: -x["score"])
|
|
|
93 |
""", unsafe_allow_html=True)
|
94 |
# result = format_predictions(top_pct(model(query)[0]))
|
95 |
# result = query
|
96 |
+
# result = model(query)[0]
|
97 |
st.write(result)
|