Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,12 +8,12 @@ import gradio as gr
|
|
| 8 |
|
| 9 |
|
| 10 |
eg_text = ' 酒店的地理位置实在不错,所以从大堂开始就令人惊艳。城景房不但在房间可以看到上海的美景'
|
| 11 |
-
|
| 12 |
|
| 13 |
max_len = 128
|
| 14 |
n_class = 2
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
-
tokenizer_cn = AutoTokenizer.from_pretrained(
|
| 17 |
voc_size = len(tokenizer_cn.vocab)
|
| 18 |
name_list = ['Negative review', 'Positive review']
|
| 19 |
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
eg_text = ' 酒店的地理位置实在不错,所以从大堂开始就令人惊艳。城景房不但在房间可以看到上海的美景'
|
| 11 |
+
model_name = 'bert-base-chinese'
|
| 12 |
|
| 13 |
max_len = 128
|
| 14 |
n_class = 2
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
+
tokenizer_cn = AutoTokenizer.from_pretrained(model_name)
|
| 17 |
voc_size = len(tokenizer_cn.vocab)
|
| 18 |
name_list = ['Negative review', 'Positive review']
|
| 19 |
|