Skip to content

Commit

Permalink
Update text_audio_emo.py
Browse files Browse the repository at this point in the history
Update text_audio_emo.py
  • Loading branch information
1933211129 authored Apr 10, 2024
1 parent 47b5a80 commit ae6d778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion speech_ai/login/py/EGG/text_audio_emo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def text_predict(self, texts):

# 初始化tokenizer和模型
tokenizer = BertTokenizerFast.from_pretrained(tokenizer_path)
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=3) # 修改为你的模型文件路径
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=3)
model.to(device)
# 输入:一系列的文本
# 输出:二维列表,每个子列表包含两个元素,第一个元素是预测结果,第二个元素是预测概率
Expand Down

0 comments on commit ae6d778

Please sign in to comment.