Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ model.eval()
|
|
13 |
|
14 |
def predict(title, abstract):
|
15 |
# 将标题和摘要处理为一个单一的字符串
|
16 |
-
text = f
|
17 |
-
inputs = tokenizer(text, return_tensors="pt"
|
18 |
with torch.no_grad():
|
19 |
outputs = model(**inputs.to(device))
|
20 |
# 应用 Sigmoid 函数来获取概率输出
|
@@ -29,8 +29,8 @@ iface = gr.Interface(
|
|
29 |
gr.Textbox(lines=5, placeholder="Enter Paper Abstract Here... (Do not input line breaks. No more than 1024 tokens.)", label="Paper Abstract")
|
30 |
],
|
31 |
outputs=gr.Label(label="Predicted Impact"),
|
32 |
-
title="Predict academic impact with LLMs",
|
33 |
-
description="Predict the normalized academic impact of a paper based on its title and abstract. Please note that the predicted impact is a probabilistic value generated by the model and does not accurately reflect the article's future citation performance. It should not be associated with writing quality, novelty, or other attributes. The author assumes no responsibility for the predictive metrics."
|
34 |
)
|
35 |
|
36 |
iface.launch()
|
|
|
13 |
|
14 |
def predict(title, abstract):
|
15 |
# 将标题和摘要处理为一个单一的字符串
|
16 |
+
text = f'''Given a certain paper, Title: {title}\n Abstract: {abstract}. \n Predict its normalized academic impact (between 0 and 1):'''
|
17 |
+
inputs = tokenizer(text, return_tensors="pt")
|
18 |
with torch.no_grad():
|
19 |
outputs = model(**inputs.to(device))
|
20 |
# 应用 Sigmoid 函数来获取概率输出
|
|
|
29 |
gr.Textbox(lines=5, placeholder="Enter Paper Abstract Here... (Do not input line breaks. No more than 1024 tokens.)", label="Paper Abstract")
|
30 |
],
|
31 |
outputs=gr.Label(label="Predicted Impact"),
|
32 |
+
title="Predict academic future impact with LLMs",
|
33 |
+
description="Predict the normalized academic impact (0-1) of a paper based on its title and abstract. !!!Important!!! Please note that the predicted impact is a probabilistic value generated by the model and does not accurately reflect the article's future citation performance. It should not be associated with writing quality, novelty, or other attributes. The author assumes no responsibility for the predictive metrics."
|
34 |
)
|
35 |
|
36 |
iface.launch()
|