模型和requirements.txt文件
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
3 |
import torch
|
4 |
|
5 |
# 加载模型和tokenizer
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
7 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
8 |
model.eval()
|
9 |
|
10 |
def predict(text):
|
|
|
3 |
import torch
|
4 |
|
5 |
# 加载模型和tokenizer
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("saved_models/model_20240302-214915_lr1e-05_optAdamW_lossBCEWithLogitsLoss_batch16_epoch10.pt")
|
7 |
+
model = AutoModelForSequenceClassification.from_pretrained("saved_models/model_20240302-214915_lr1e-05_optAdamW_lossBCEWithLogitsLoss_batch16_epoch10.pt", num_labels=8)
|
8 |
model.eval()
|
9 |
|
10 |
def predict(text):
|
requirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pandas==2.0.3
|
2 |
+
scikit_learn==1.3.0
|
3 |
+
streamlit==1.30.0
|
4 |
+
torch==1.12.0+cu113
|
5 |
+
tqdm==4.66.2
|
6 |
+
transformers==4.38.2
|
saved_models/model_20240302-214915_lr1e-05_optAdamW_lossBCEWithLogitsLoss_batch16_epoch10.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e234498b500c17533d6bfc03c4b9e515f2114b33263345cf8ba79810340eea20
|
3 |
+
size 433346287
|