Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import subprocess
|
|
5 |
def generate_text(length, prefix, temperature,topk,topp,rep):
|
6 |
# 构建命令行参数
|
7 |
my_prefix = "--prefix=" + prefix + ","
|
8 |
-
args = ["python", "generate.py", f"--length={int(length)}", f"--nsamples=1", f"--prefix={prefix}", f"--temperature={temperature}",f"--batch_size=1",f"--topk={int(topk)}",f"--topp={topp}",f"--repetition_penalty={rep}","--fast_pattern","--
|
9 |
|
10 |
# 执行命令并获取输出
|
11 |
process = subprocess.Popen(args, stdout=subprocess.PIPE)
|
|
|
5 |
def generate_text(length, prefix, temperature,topk,topp,rep):
|
6 |
# 构建命令行参数
|
7 |
my_prefix = "--prefix=" + prefix + ","
|
8 |
+
args = ["python", "generate.py", f"--length={int(length)}", f"--nsamples=1", f"--prefix={prefix}", f"--temperature={temperature}",f"--batch_size=1",f"--topk={int(topk)}",f"--topp={topp}",f"--repetition_penalty={rep}","--fast_pattern","--tokenizer_path=./vocab.txt","--config_path=./config.json"]
|
9 |
|
10 |
# 执行命令并获取输出
|
11 |
process = subprocess.Popen(args, stdout=subprocess.PIPE)
|