Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import streamlit as st
|
|
2 |
import torch
|
3 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
4 |
|
5 |
-
|
6 |
@st.cache_resource
|
7 |
def load_model():
|
8 |
checkpoint = torch.load('TinyBERT_cls_model.pt', map_location='cpu')
|
@@ -43,7 +42,6 @@ def predict(title, abstract, model, tokenizer, idx_to_category, threshold=0.95):
|
|
43 |
|
44 |
return results, cumulative_prob
|
45 |
|
46 |
-
|
47 |
def main():
|
48 |
model, tokenizer, idx_to_category = load_model()
|
49 |
st.set_page_config(page_title="arXiv Classifier", layout="wide")
|
@@ -82,6 +80,5 @@ def main():
|
|
82 |
with col2:
|
83 |
st.progress(res['probability'], text=res['category'])
|
84 |
|
85 |
-
|
86 |
if __name__ == "__main__":
|
87 |
main()
|
|
|
2 |
import torch
|
3 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
4 |
|
|
|
5 |
@st.cache_resource
|
6 |
def load_model():
|
7 |
checkpoint = torch.load('TinyBERT_cls_model.pt', map_location='cpu')
|
|
|
42 |
|
43 |
return results, cumulative_prob
|
44 |
|
|
|
45 |
def main():
|
46 |
model, tokenizer, idx_to_category = load_model()
|
47 |
st.set_page_config(page_title="arXiv Classifier", layout="wide")
|
|
|
80 |
with col2:
|
81 |
st.progress(res['probability'], text=res['category'])
|
82 |
|
|
|
83 |
if __name__ == "__main__":
|
84 |
main()
|