Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
4 |
-
from PIL import Image
|
5 |
-
import requests
|
6 |
-
from io import BytesIO
|
7 |
-
|
8 |
-
|
9 |
-
@st.cache_data
|
10 |
-
def load_header_image():
|
11 |
-
response = requests.get(
|
12 |
-
"https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/ArXiv_logo_2022.svg/512px-ArXiv_logo_2022.svg.png"
|
13 |
-
)
|
14 |
-
return Image.open(BytesIO(response.content))
|
15 |
|
16 |
|
17 |
@st.cache_resource
|
@@ -57,8 +46,6 @@ def predict(title, abstract, model, tokenizer, idx_to_category, threshold=0.95):
|
|
57 |
|
58 |
def main():
|
59 |
model, tokenizer, idx_to_category = load_model()
|
60 |
-
header_img = load_header_image()
|
61 |
-
|
62 |
st.set_page_config(page_title="arXiv Classifier", layout="wide")
|
63 |
|
64 |
col1, col2 = st.columns([1, 4])
|
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
@st.cache_resource
|
|
|
46 |
|
47 |
def main():
|
48 |
model, tokenizer, idx_to_category = load_model()
|
|
|
|
|
49 |
st.set_page_config(page_title="arXiv Classifier", layout="wide")
|
50 |
|
51 |
col1, col2 = st.columns([1, 4])
|