Skip to content
This repository was archived by the owner on Mar 7, 2020. It is now read-only.

Commit baf94bd

Browse files
committed
no message
1 parent 0338048 commit baf94bd

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

usage_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import torch
33
if __name__ == "__main__":
44
tokenizer = AlbertTokenizer.from_pretrained('albert_tiny/vocab.txt')
5-
model_config = AlbertConfig.from_json_file('albert_tiny/albert_config_tiny.json')
6-
model = AlbertForSequenceClassification.from_pretrained('albert_tiny/albert_tiny_torch.bin',config = model_config)
5+
model_config = AlbertConfig.from_json_file('./albert_tiny/config.json')
6+
model = AlbertForSequenceClassification.from_pretrained('./albert_tiny',config = model_config)
77

88
intput_str = '周杰倫,臺灣著名華語流行歌曲男歌手、音樂家、唱片製片人。同時是演員、導演,也是電競團隊隊長兼老闆、服飾品牌老闆。以其個人風格和聲歌手樂創作能力著稱,影響華語樂壇。 在2000年,周杰倫發行了他的首張專輯《Jay》,從屬於唱片公司阿爾發音樂。'
99
input_ids = torch.tensor(tokenizer.encode(intput_str)).unsqueeze(0) # Batch size 1

0 commit comments

Comments
 (0)