Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from urllib.parse import urlparse
|
|
8 |
import xml.etree.ElementTree as ET
|
9 |
|
10 |
# ๋ชจ๋ธ ๊ฒฝ๋ก์ ๋๋ฐ์ด์ค ์ค์
|
11 |
-
model_path =
|
12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
13 |
|
14 |
# ์ ์ญ ๋ณ์๋ก ๋ชจ๋ธยทํ ํฌ๋์ด์ ์ ์ธ
|
@@ -16,7 +16,7 @@ model = None
|
|
16 |
tokenizer = None
|
17 |
|
18 |
def fetch_arxiv_paper(arxiv_input):
|
19 |
-
"""arXiv URL ๋๋ ID๋ก๋ถํฐ ์ ๋ชฉ๊ณผ ์์ฝ
|
20 |
try:
|
21 |
if 'arxiv.org' in arxiv_input:
|
22 |
parsed = urlparse(arxiv_input)
|
@@ -48,9 +48,10 @@ def predict(title, abstract):
|
|
48 |
model = AutoModelForSequenceClassification.from_pretrained(
|
49 |
model_path,
|
50 |
num_labels=1,
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
54 |
low_cpu_mem_usage=False
|
55 |
)
|
56 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
@@ -139,7 +140,7 @@ css = """
|
|
139 |
background: white;
|
140 |
padding: 2rem;
|
141 |
border-radius: 1rem;
|
142 |
-
box-shadow: 0 4px 6px -1px
|
143 |
}
|
144 |
.result-section {
|
145 |
background: #f8fafc;
|
|
|
8 |
import xml.etree.ElementTree as ET
|
9 |
|
10 |
# ๋ชจ๋ธ ๊ฒฝ๋ก์ ๋๋ฐ์ด์ค ์ค์
|
11 |
+
model_path = 'ssocean/NAIP'
|
12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
13 |
|
14 |
# ์ ์ญ ๋ณ์๋ก ๋ชจ๋ธยทํ ํฌ๋์ด์ ์ ์ธ
|
|
|
16 |
tokenizer = None
|
17 |
|
18 |
def fetch_arxiv_paper(arxiv_input):
|
19 |
+
"""arXiv URL ๋๋ ID๋ก๋ถํฐ ์ ๋ชฉ๊ณผ ์์ฝ ๊ฐ์ ธ์ค๊ธฐ"""
|
20 |
try:
|
21 |
if 'arxiv.org' in arxiv_input:
|
22 |
parsed = urlparse(arxiv_input)
|
|
|
48 |
model = AutoModelForSequenceClassification.from_pretrained(
|
49 |
model_path,
|
50 |
num_labels=1,
|
51 |
+
torch_dtype=torch.float32, # ์ ์ฒด float32
|
52 |
+
device_map=None, # ์๋ ๋ถ์ฐ ๋นํ์ฑํ
|
53 |
+
load_in_8bit=False,
|
54 |
+
load_in_4bit=False,
|
55 |
low_cpu_mem_usage=False
|
56 |
)
|
57 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
|
|
140 |
background: white;
|
141 |
padding: 2rem;
|
142 |
border-radius: 1rem;
|
143 |
+
box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
|
144 |
}
|
145 |
.result-section {
|
146 |
background: #f8fafc;
|