Spaces:
Runtime error
Runtime error
huolongguo10
commited on
Commit
·
9ac6c7f
1
Parent(s):
e4a9c89
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ import gradio as gr
|
|
3 |
import clueai
|
4 |
import torch
|
5 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
6 |
-
tokenizer = T5Tokenizer.from_pretrained("
|
7 |
-
model = T5ForConditionalGeneration.from_pretrained("
|
8 |
# 使用
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
10 |
model.to(device)
|
11 |
|
12 |
-
base_info = "用户:你是谁?\n
|
13 |
def preprocess(text):
|
14 |
text = f"{base_info}{text}"
|
15 |
text = text.replace("\n", "\\n").replace("\t", "\\t")
|
|
|
3 |
import clueai
|
4 |
import torch
|
5 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
6 |
+
tokenizer = T5Tokenizer.from_pretrained("huolongguo10/HR_Chat")
|
7 |
+
model = T5ForConditionalGeneration.from_pretrained("huolongguo10/HR_Chat")
|
8 |
# 使用
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
10 |
model.to(device)
|
11 |
|
12 |
+
base_info = "用户:你是谁?\n小元:我是huolongguo10助手智能助手。\n"
|
13 |
def preprocess(text):
|
14 |
text = f"{base_info}{text}"
|
15 |
text = text.replace("\n", "\\n").replace("\t", "\\t")
|