google-research

Форк
0
160 строк · 2.4 Кб
1
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
2

3
package(
4
    default_visibility = ["//visibility:public"],
5
    licenses = ["notice"],
6
)
7

8
cc_library(
9
    name = "tf_dependency",
10
    tags = ["local"],
11
    deps = [
12
        "@local_config_tf//:libtensorflow_framework",
13
        "@local_config_tf//:tf_header_lib",
14
    ],
15
)
16

17
cc_binary(
18
    name = "_custom_ops.so",
19
    srcs = [
20
        "custom_ops.cc",
21
    ],
22
    copts = [
23
        "-pthread",
24
        "-std=c++11",
25
        "-D_GLIBCXX_USE_CXX11_ABI=0",
26
    ],
27
    linkshared = 1,
28
    deps = [
29
        ":tf_dependency",
30
    ],
31
)
32

33
py_library(
34
    name = "custom_ops_py",
35
    srcs = [
36
        "custom_ops.py",
37
    ],
38
    data = [
39
        ":_custom_ops.so",
40
        "@rules_python//python/runfiles",
41
    ],
42
    srcs_version = "PY3",
43
)
44

45
py_library(
46
    name = "model",
47
    srcs = ["model.py"],
48
    srcs_version = "PY3",
49
    deps = [
50
        ":custom_ops_py",
51
        ":encoding",
52
        ":env",
53
    ],
54
)
55

56
py_library(
57
    name = "bert_client",
58
    srcs = [
59
        "bert_client.py",
60
    ],
61
    deps = [
62
    ],
63
)
64

65
py_library(
66
    name = "word2vec_client",
67
    srcs = ["word2vec_client.py"],
68
    deps = [
69
    ],
70
)
71

72
py_library(
73
    name = "encoding",
74
    srcs = ["encoding.py"],
75
    deps = [
76
    ],
77
)
78

79
py_library(
80
    name = "env",
81
    srcs = ["env.py"],
82
    deps = [
83
        ":encoding",
84
    ],
85
)
86

87
filegroup(
88
    name = "contrack_people_names",
89
    srcs = [
90
        "data/female_names.txt",
91
        "data/male_names.txt",
92
    ],
93
)
94

95
py_library(
96
    name = "signals",
97
    srcs = ["signals.py"],
98
    data = [
99
        ":contrack_people_names",
100
    ],
101
    deps = [
102
        "@bazel_tools//tools/python/runfiles",
103
    ],
104
)
105

106
py_library(
107
    name = "data",
108
    srcs = ["data.py"],
109
    deps = [
110
        ":encoding",
111
        ":env",
112
    ],
113
)
114

115
py_library(
116
    name = "train_lib",
117
    srcs = ["train.py"],
118
    deps = [
119
        ":data",
120
        ":encoding",
121
        ":env",
122
        ":model",
123
    ],
124
)
125

126
py_binary(
127
    name = "train",
128
    srcs = ["train.py"],
129
    srcs_version = "PY3",
130
    deps = [
131
        ":train_lib",
132
    ],
133
)
134

135
py_binary(
136
    name = "preprocess",
137
    srcs = [
138
        "preprocess.py",
139
    ],
140
    srcs_version = "PY3",
141
    deps = [
142
        ":bert_client",
143
        ":encoding",
144
        ":signals",
145
        ":word2vec_client",
146
    ],
147
)
148

149
py_binary(
150
    name = "predict",
151
    srcs = ["predict.py"],
152
    srcs_version = "PY3",
153
    deps = [
154
        ":data",
155
        ":encoding",
156
        ":env",
157
        ":model",
158
        ":signals",
159
    ],
160
)
161

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.