Update app.py
Browse files
app.py
CHANGED
|
@@ -72,7 +72,7 @@ def BuildAnswer(txt):
|
|
| 72 |
res = round(float(logits[tag.item()].cpu()) * 100)
|
| 73 |
label = labels_articles[tag.item() + 1]
|
| 74 |
result.append(f'{res:3d}% - {label}')
|
| 75 |
-
return
|
| 76 |
|
| 77 |
|
| 78 |
|
|
@@ -89,4 +89,5 @@ abstract = st.text_area("Abstract:", height=400)
|
|
| 89 |
# тут уже знакомый вам код с huggingface.transformers -- его можно заменить на что угодно от fairseq до catboost
|
| 90 |
result = BuildAnswer(title + ' ' + abstract)
|
| 91 |
|
| 92 |
-
|
|
|
|
|
|
| 72 |
res = round(float(logits[tag.item()].cpu()) * 100)
|
| 73 |
label = labels_articles[tag.item() + 1]
|
| 74 |
result.append(f'{res:3d}% - {label}')
|
| 75 |
+
return result
|
| 76 |
|
| 77 |
|
| 78 |
|
|
|
|
| 89 |
# тут уже знакомый вам код с huggingface.transformers -- его можно заменить на что угодно от fairseq до catboost
|
| 90 |
result = BuildAnswer(title + ' ' + abstract)
|
| 91 |
|
| 92 |
+
for res in result:
|
| 93 |
+
st.markdown(f"{res}")
|