xu-song commited on
Commit
6551d2c
1 Parent(s): d2551ad
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -4,13 +4,13 @@
4
 
5
  """
6
  ## TODO:
7
- - http get方式获取参数,
 
8
  - iter_vocab 的 warmup
9
  - add_special_token 开关
10
  - theme 开关 light/dark
11
  - token_id/tokens/bytes 开关
12
  - 通过 javascript 添加 hover_text
13
- - i18
14
  - 给方法 + 缓存,避免重复调用
15
  - 英文 utf-8编码
16
  - 词典支持下载
@@ -41,15 +41,22 @@ from vocab import all_tokenizers
41
  from util import *
42
 
43
  # llama chatglm_6b gpt_nexo_20b baichuan baichuan_7b
44
- examples = [
45
  ["空格测试: 2个空格 8个空格", "llama", "chatglm_6b"], # chatglm 有blank_n,
46
  ["标点测试:,。!?;", "baichuan_7b", "llama"],
47
  ["符号测试:🦙❤❥웃유♋☮✊☏☢☚✔☑♚▢♪✈✞÷↑↓▤▥⊙■□▣▽¿─│♥❣▬▫☿Ⓐ ✋✉☣☤", "baichuan_7b", "llama"],
48
  ["数字测试:(10086 + 98) = 100184", "baichuan_7b", "llama"],
49
  ["中文简体:宽带,繁体:樂來", "baichuan_7b", "llama"],
 
50
 
 
 
 
 
 
51
  ]
52
 
 
53
  # jieba.enable_parallel() # flask中没办法parallel
54
 
55
 
 
4
 
5
  """
6
  ## TODO:
7
+ - http get方式获取参数,(高优先级)
8
+ - i18 国际化 https://blog.csdn.net/qq_26212731/article/details/78457198 request.header中也有language
9
  - iter_vocab 的 warmup
10
  - add_special_token 开关
11
  - theme 开关 light/dark
12
  - token_id/tokens/bytes 开关
13
  - 通过 javascript 添加 hover_text
 
14
  - 给方法 + 缓存,避免重复调用
15
  - 英文 utf-8编码
16
  - 词典支持下载
 
41
  from util import *
42
 
43
  # llama chatglm_6b gpt_nexo_20b baichuan baichuan_7b
44
+ examples_zh = [
45
  ["空格测试: 2个空格 8个空格", "llama", "chatglm_6b"], # chatglm 有blank_n,
46
  ["标点测试:,。!?;", "baichuan_7b", "llama"],
47
  ["符号测试:🦙❤❥웃유♋☮✊☏☢☚✔☑♚▢♪✈✞÷↑↓▤▥⊙■□▣▽¿─│♥❣▬▫☿Ⓐ ✋✉☣☤", "baichuan_7b", "llama"],
48
  ["数字测试:(10086 + 98) = 100184", "baichuan_7b", "llama"],
49
  ["中文简体:宽带,繁体:樂來", "baichuan_7b", "llama"],
50
+ ]
51
 
52
+ examples = [
53
+ ["spaces: 2spaces 8spaces", "llama", "chatglm_6b"], # chatglm 有blank_n,
54
+ ["punctuations: ,./?\",。!?;", "baichuan_7b", "llama"],
55
+ ["symbols: 🦙❤❥웃유♋☮✊☏☢☚✔☑♚▢♪✈✞÷↑↓▤▥⊙■□▣▽¿─│♥❣▬▫☿Ⓐ ✋✉☣☤", "baichuan_7b", "llama"],
56
+ ["digits: (10086 + 98) = 100184", "baichuan_7b", "llama"],
57
  ]
58
 
59
+
60
  # jieba.enable_parallel() # flask中没办法parallel
61
 
62