File size: 994 Bytes
c99a3a6
 
 
b3d05d2
c94015f
c99a3a6
c94015f
c99a3a6
 
 
 
 
d08ef80
c94015f
 
 
c99a3a6
 
 
 
 
 
c94015f
c99a3a6
 
 
 
 
 
 
c94015f
c99a3a6
 
 
 
 
c94015f
c99a3a6
c94015f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 安装好环境
# python app.py即可运行
import os

os.environ['HF_ENDPOINT']='https://hf-mirror.com'

from argparse import Namespace
args = Namespace()

arg_dict = {
    'run_gradio': True,
    'demo_public': False,
    'model_name_or_path': './model/Qwen2-0.5B-Instruct',

    # 'model_name_or_path': 'Qwen/Qwen2-0.5B-Instruct-GGUF',
    'gguf_file': './qwen2-0_5b-instruct-q8_0.gguf', # 只有用gguf模型会用到,即model_name_or_path里含有gguf字符串才会用到
    'prompt_max_length': None,
    'max_new_tokens': 500,
    'generation_seed': 123,
    'use_sampling': True,
    'n_beams': 1,
    'sampling_temp': 0.7,
    'use_gpu': True,
    'seeding_scheme': 'simple_1',
    'gamma': 0.5,
    'delta': 2.0,
    'normalizers': '',
    'ignore_repeated_bigrams': False,
    'detection_z_threshold': 4.0,
    'select_green_tokens': True,
    'skip_model_load': False,
    'seed_separately': True,
}

args.__dict__.update(arg_dict)

from demo_watermark import main

main(args)