├── .github ├── dependabot.yml └── workflows │ └── test.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── README.md ├── img └── server_output.png └── src └── main.rs /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "cargo" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | schedule: 11 | - cron: '0 10 * * *' # run at 10 AM UTC 12 | 13 | jobs: 14 | test: 15 | name: test 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | 20 | - name: Install Rust Stable 21 | uses: actions-rs/toolchain@v1 22 | with: 23 | toolchain: stable 24 | components: rustfmt, clippy 25 | override: true 26 | 27 | - name: Cache Cargo Registry 28 | uses: actions/cache@v2 29 | with: 30 | path: ~/.cargo/registry 31 | key: ${{ runner.os }}-cargo-test-registry-${{ hashFiles('**/Cargo.lock') }} 32 | 33 | - name: Cache Cargo Build 34 | uses: actions/cache@v2 35 | with: 36 | path: target 37 | key: ${{ runner.os }}-cargo-test-build-${{ hashFiles('**/Cargo.lock') }} 38 | 39 | - name: Lint with RustFmt 40 | if: always() 41 | uses: actions-rs/cargo@v1 42 | with: 43 | command: fmt 44 | args: -- --check 45 | 46 | - name: Lint with Clippy 47 | if: always() 48 | uses: actions-rs/cargo@v1 49 | with: 50 | command: clippy 51 | args: --all-targets --all-features -- -D warnings 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler32" 7 | version = "1.2.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 10 | 11 | [[package]] 12 | name = "ahash" 13 | version = "0.4.7" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" 16 | 17 | [[package]] 18 | name = "aho-corasick" 19 | version = "0.7.15" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" 22 | dependencies = [ 23 | "memchr", 24 | ] 25 | 26 | [[package]] 27 | name = "anyhow" 28 | version = "1.0.38" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" 31 | 32 | [[package]] 33 | name = "atty" 34 | version = "0.2.14" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 37 | dependencies = [ 38 | "hermit-abi", 39 | "libc", 40 | "winapi", 41 | ] 42 | 43 | [[package]] 44 | name = "autocfg" 45 | version = "1.0.1" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 48 | 49 | [[package]] 50 | name = "base64" 51 | version = "0.13.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 54 | 55 | [[package]] 56 | name = "batched-fn" 57 | version = "0.2.3" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "90ed49f8d4f23c21f4c0eacaa06470ba2cb3be8edcf57082472b8ad5c9332b17" 60 | dependencies = [ 61 | "flume", 62 | "futures", 63 | "once_cell", 64 | ] 65 | 66 | [[package]] 67 | name = "bitflags" 68 | version = "1.2.1" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 71 | 72 | [[package]] 73 | name = "block-buffer" 74 | version = "0.9.0" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 77 | dependencies = [ 78 | "generic-array", 79 | ] 80 | 81 | [[package]] 82 | name = "bstr" 83 | version = "0.2.15" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" 86 | dependencies = [ 87 | "lazy_static", 88 | "memchr", 89 | "regex-automata", 90 | "serde", 91 | ] 92 | 93 | [[package]] 94 | name = "buf_redux" 95 | version = "0.8.4" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" 98 | dependencies = [ 99 | "memchr", 100 | "safemem", 101 | ] 102 | 103 | [[package]] 104 | name = "bumpalo" 105 | version = "3.6.1" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" 108 | 109 | [[package]] 110 | name = "byteorder" 111 | version = "1.4.2" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" 114 | 115 | [[package]] 116 | name = "bytes" 117 | version = "1.0.1" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" 120 | 121 | [[package]] 122 | name = "bzip2" 123 | version = "0.3.3" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" 126 | dependencies = [ 127 | "bzip2-sys", 128 | "libc", 129 | ] 130 | 131 | [[package]] 132 | name = "bzip2-sys" 133 | version = "0.1.10+1.0.8" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" 136 | dependencies = [ 137 | "cc", 138 | "libc", 139 | "pkg-config", 140 | ] 141 | 142 | [[package]] 143 | name = "cached-path" 144 | version = "0.5.0" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "ddf3f4e7452873f4013b54caf0c69ee5a438927c30653508071d9dc0ecdf9f77" 147 | dependencies = [ 148 | "flate2", 149 | "fs2", 150 | "glob", 151 | "indicatif", 152 | "log", 153 | "rand 0.8.3", 154 | "reqwest", 155 | "serde", 156 | "serde_json", 157 | "sha2", 158 | "tar", 159 | "tempfile", 160 | "thiserror", 161 | "zip", 162 | "zip-extensions", 163 | ] 164 | 165 | [[package]] 166 | name = "cc" 167 | version = "1.0.67" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" 170 | 171 | [[package]] 172 | name = "cfg-if" 173 | version = "0.1.10" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 176 | 177 | [[package]] 178 | name = "cfg-if" 179 | version = "1.0.0" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 182 | 183 | [[package]] 184 | name = "cmake" 185 | version = "0.1.45" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" 188 | dependencies = [ 189 | "cc", 190 | ] 191 | 192 | [[package]] 193 | name = "console" 194 | version = "0.14.0" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "7cc80946b3480f421c2f17ed1cb841753a371c7c5104f51d507e13f532c856aa" 197 | dependencies = [ 198 | "encode_unicode", 199 | "lazy_static", 200 | "libc", 201 | "regex", 202 | "terminal_size", 203 | "unicode-width", 204 | "winapi", 205 | ] 206 | 207 | [[package]] 208 | name = "core-foundation" 209 | version = "0.9.1" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 212 | dependencies = [ 213 | "core-foundation-sys", 214 | "libc", 215 | ] 216 | 217 | [[package]] 218 | name = "core-foundation-sys" 219 | version = "0.8.2" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 222 | 223 | [[package]] 224 | name = "cpuid-bool" 225 | version = "0.1.2" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" 228 | 229 | [[package]] 230 | name = "crc32fast" 231 | version = "1.2.1" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" 234 | dependencies = [ 235 | "cfg-if 1.0.0", 236 | ] 237 | 238 | [[package]] 239 | name = "crossbeam-channel" 240 | version = "0.5.0" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" 243 | dependencies = [ 244 | "cfg-if 1.0.0", 245 | "crossbeam-utils", 246 | ] 247 | 248 | [[package]] 249 | name = "crossbeam-deque" 250 | version = "0.8.0" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" 253 | dependencies = [ 254 | "cfg-if 1.0.0", 255 | "crossbeam-epoch", 256 | "crossbeam-utils", 257 | ] 258 | 259 | [[package]] 260 | name = "crossbeam-epoch" 261 | version = "0.9.3" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" 264 | dependencies = [ 265 | "cfg-if 1.0.0", 266 | "crossbeam-utils", 267 | "lazy_static", 268 | "memoffset", 269 | "scopeguard", 270 | ] 271 | 272 | [[package]] 273 | name = "crossbeam-utils" 274 | version = "0.8.3" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" 277 | dependencies = [ 278 | "autocfg", 279 | "cfg-if 1.0.0", 280 | "lazy_static", 281 | ] 282 | 283 | [[package]] 284 | name = "csv" 285 | version = "1.1.5" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" 288 | dependencies = [ 289 | "bstr", 290 | "csv-core", 291 | "itoa", 292 | "ryu", 293 | "serde", 294 | ] 295 | 296 | [[package]] 297 | name = "csv-core" 298 | version = "0.1.10" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" 301 | dependencies = [ 302 | "memchr", 303 | ] 304 | 305 | [[package]] 306 | name = "curl" 307 | version = "0.4.34" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "e268162af1a5fe89917ae25ba3b0a77c8da752bdc58e7dbb4f15b91fbd33756e" 310 | dependencies = [ 311 | "curl-sys", 312 | "libc", 313 | "openssl-probe", 314 | "openssl-sys", 315 | "schannel", 316 | "socket2", 317 | "winapi", 318 | ] 319 | 320 | [[package]] 321 | name = "curl-sys" 322 | version = "0.4.40+curl-7.75.0" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "2ffafc1c35958318bd7fdd0582995ce4c72f4f461a8e70499ccee83a619fd562" 325 | dependencies = [ 326 | "cc", 327 | "libc", 328 | "libz-sys", 329 | "openssl-sys", 330 | "pkg-config", 331 | "vcpkg", 332 | "winapi", 333 | ] 334 | 335 | [[package]] 336 | name = "digest" 337 | version = "0.9.0" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 340 | dependencies = [ 341 | "generic-array", 342 | ] 343 | 344 | [[package]] 345 | name = "dirs" 346 | version = "3.0.2" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" 349 | dependencies = [ 350 | "dirs-sys", 351 | ] 352 | 353 | [[package]] 354 | name = "dirs" 355 | version = "4.0.0" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 358 | dependencies = [ 359 | "dirs-sys", 360 | ] 361 | 362 | [[package]] 363 | name = "dirs-sys" 364 | version = "0.3.6" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" 367 | dependencies = [ 368 | "libc", 369 | "redox_users", 370 | "winapi", 371 | ] 372 | 373 | [[package]] 374 | name = "dl-webserver" 375 | version = "0.1.0" 376 | dependencies = [ 377 | "batched-fn", 378 | "dirs 4.0.0", 379 | "env_logger", 380 | "log", 381 | "rust-bert", 382 | "serde", 383 | "tch", 384 | "tokio", 385 | "warp", 386 | ] 387 | 388 | [[package]] 389 | name = "either" 390 | version = "1.6.1" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 393 | 394 | [[package]] 395 | name = "encode_unicode" 396 | version = "0.3.6" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 399 | 400 | [[package]] 401 | name = "encoding_rs" 402 | version = "0.8.28" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" 405 | dependencies = [ 406 | "cfg-if 1.0.0", 407 | ] 408 | 409 | [[package]] 410 | name = "env_logger" 411 | version = "0.9.0" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" 414 | dependencies = [ 415 | "atty", 416 | "humantime", 417 | "log", 418 | "regex", 419 | "termcolor", 420 | ] 421 | 422 | [[package]] 423 | name = "filetime" 424 | version = "0.2.14" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" 427 | dependencies = [ 428 | "cfg-if 1.0.0", 429 | "libc", 430 | "redox_syscall", 431 | "winapi", 432 | ] 433 | 434 | [[package]] 435 | name = "flate2" 436 | version = "1.0.14" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" 439 | dependencies = [ 440 | "cfg-if 0.1.10", 441 | "crc32fast", 442 | "libc", 443 | "miniz_oxide", 444 | ] 445 | 446 | [[package]] 447 | name = "flume" 448 | version = "0.10.2" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "531a685ab99b8f60a271b44d5dd1a76e55124a8c9fa0407b7a8e9cd172d5b588" 451 | dependencies = [ 452 | "futures-core", 453 | "futures-sink", 454 | "nanorand", 455 | "pin-project", 456 | "spinning_top", 457 | ] 458 | 459 | [[package]] 460 | name = "fnv" 461 | version = "1.0.7" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 464 | 465 | [[package]] 466 | name = "foreign-types" 467 | version = "0.3.2" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 470 | dependencies = [ 471 | "foreign-types-shared", 472 | ] 473 | 474 | [[package]] 475 | name = "foreign-types-shared" 476 | version = "0.1.1" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 479 | 480 | [[package]] 481 | name = "form_urlencoded" 482 | version = "1.0.1" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 485 | dependencies = [ 486 | "matches", 487 | "percent-encoding", 488 | ] 489 | 490 | [[package]] 491 | name = "fs2" 492 | version = "0.4.3" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" 495 | dependencies = [ 496 | "libc", 497 | "winapi", 498 | ] 499 | 500 | [[package]] 501 | name = "futures" 502 | version = "0.3.13" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" 505 | dependencies = [ 506 | "futures-channel", 507 | "futures-core", 508 | "futures-io", 509 | "futures-sink", 510 | "futures-task", 511 | "futures-util", 512 | ] 513 | 514 | [[package]] 515 | name = "futures-channel" 516 | version = "0.3.13" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" 519 | dependencies = [ 520 | "futures-core", 521 | "futures-sink", 522 | ] 523 | 524 | [[package]] 525 | name = "futures-core" 526 | version = "0.3.13" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" 529 | 530 | [[package]] 531 | name = "futures-io" 532 | version = "0.3.13" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" 535 | 536 | [[package]] 537 | name = "futures-sink" 538 | version = "0.3.13" 539 | source = "registry+https://github.com/rust-lang/crates.io-index" 540 | checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" 541 | 542 | [[package]] 543 | name = "futures-task" 544 | version = "0.3.13" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" 547 | 548 | [[package]] 549 | name = "futures-util" 550 | version = "0.3.13" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" 553 | dependencies = [ 554 | "futures-channel", 555 | "futures-core", 556 | "futures-io", 557 | "futures-sink", 558 | "futures-task", 559 | "memchr", 560 | "pin-project-lite", 561 | "pin-utils", 562 | "slab", 563 | ] 564 | 565 | [[package]] 566 | name = "generic-array" 567 | version = "0.14.4" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" 570 | dependencies = [ 571 | "typenum", 572 | "version_check", 573 | ] 574 | 575 | [[package]] 576 | name = "getrandom" 577 | version = "0.1.16" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 580 | dependencies = [ 581 | "cfg-if 1.0.0", 582 | "libc", 583 | "wasi 0.9.0+wasi-snapshot-preview1", 584 | ] 585 | 586 | [[package]] 587 | name = "getrandom" 588 | version = "0.2.2" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" 591 | dependencies = [ 592 | "cfg-if 1.0.0", 593 | "js-sys", 594 | "libc", 595 | "wasi 0.10.2+wasi-snapshot-preview1", 596 | "wasm-bindgen", 597 | ] 598 | 599 | [[package]] 600 | name = "glob" 601 | version = "0.3.0" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 604 | 605 | [[package]] 606 | name = "h2" 607 | version = "0.3.1" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "d832b01df74254fe364568d6ddc294443f61cbec82816b60904303af87efae78" 610 | dependencies = [ 611 | "bytes", 612 | "fnv", 613 | "futures-core", 614 | "futures-sink", 615 | "futures-util", 616 | "http", 617 | "indexmap", 618 | "slab", 619 | "tokio", 620 | "tokio-util", 621 | "tracing", 622 | ] 623 | 624 | [[package]] 625 | name = "half" 626 | version = "1.7.1" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" 629 | 630 | [[package]] 631 | name = "hashbrown" 632 | version = "0.9.1" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" 635 | dependencies = [ 636 | "ahash", 637 | ] 638 | 639 | [[package]] 640 | name = "headers" 641 | version = "0.3.4" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855" 644 | dependencies = [ 645 | "base64", 646 | "bitflags", 647 | "bytes", 648 | "headers-core", 649 | "http", 650 | "mime", 651 | "sha-1", 652 | "time", 653 | ] 654 | 655 | [[package]] 656 | name = "headers-core" 657 | version = "0.2.0" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" 660 | dependencies = [ 661 | "http", 662 | ] 663 | 664 | [[package]] 665 | name = "hermit-abi" 666 | version = "0.1.18" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" 669 | dependencies = [ 670 | "libc", 671 | ] 672 | 673 | [[package]] 674 | name = "http" 675 | version = "0.2.3" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" 678 | dependencies = [ 679 | "bytes", 680 | "fnv", 681 | "itoa", 682 | ] 683 | 684 | [[package]] 685 | name = "http-body" 686 | version = "0.4.0" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" 689 | dependencies = [ 690 | "bytes", 691 | "http", 692 | ] 693 | 694 | [[package]] 695 | name = "httparse" 696 | version = "1.3.5" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" 699 | 700 | [[package]] 701 | name = "httpdate" 702 | version = "0.3.2" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" 705 | 706 | [[package]] 707 | name = "humantime" 708 | version = "2.1.0" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 711 | 712 | [[package]] 713 | name = "hyper" 714 | version = "0.14.4" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" 717 | dependencies = [ 718 | "bytes", 719 | "futures-channel", 720 | "futures-core", 721 | "futures-util", 722 | "h2", 723 | "http", 724 | "http-body", 725 | "httparse", 726 | "httpdate", 727 | "itoa", 728 | "pin-project", 729 | "socket2", 730 | "tokio", 731 | "tower-service", 732 | "tracing", 733 | "want", 734 | ] 735 | 736 | [[package]] 737 | name = "hyper-tls" 738 | version = "0.5.0" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 741 | dependencies = [ 742 | "bytes", 743 | "hyper", 744 | "native-tls", 745 | "tokio", 746 | "tokio-native-tls", 747 | ] 748 | 749 | [[package]] 750 | name = "idna" 751 | version = "0.2.2" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" 754 | dependencies = [ 755 | "matches", 756 | "unicode-bidi", 757 | "unicode-normalization", 758 | ] 759 | 760 | [[package]] 761 | name = "indexmap" 762 | version = "1.6.2" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" 765 | dependencies = [ 766 | "autocfg", 767 | "hashbrown", 768 | ] 769 | 770 | [[package]] 771 | name = "indicatif" 772 | version = "0.15.0" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" 775 | dependencies = [ 776 | "console", 777 | "lazy_static", 778 | "number_prefix", 779 | "regex", 780 | ] 781 | 782 | [[package]] 783 | name = "input_buffer" 784 | version = "0.4.0" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" 787 | dependencies = [ 788 | "bytes", 789 | ] 790 | 791 | [[package]] 792 | name = "instant" 793 | version = "0.1.9" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" 796 | dependencies = [ 797 | "cfg-if 1.0.0", 798 | ] 799 | 800 | [[package]] 801 | name = "ipnet" 802 | version = "2.3.0" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 805 | 806 | [[package]] 807 | name = "itertools" 808 | version = "0.9.0" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" 811 | dependencies = [ 812 | "either", 813 | ] 814 | 815 | [[package]] 816 | name = "itertools" 817 | version = "0.10.0" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" 820 | dependencies = [ 821 | "either", 822 | ] 823 | 824 | [[package]] 825 | name = "itoa" 826 | version = "0.4.7" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 829 | 830 | [[package]] 831 | name = "js-sys" 832 | version = "0.3.48" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" 835 | dependencies = [ 836 | "wasm-bindgen", 837 | ] 838 | 839 | [[package]] 840 | name = "lazy_static" 841 | version = "1.4.0" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 844 | 845 | [[package]] 846 | name = "libc" 847 | version = "0.2.88" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" 850 | 851 | [[package]] 852 | name = "libz-sys" 853 | version = "1.1.2" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" 856 | dependencies = [ 857 | "cc", 858 | "libc", 859 | "pkg-config", 860 | "vcpkg", 861 | ] 862 | 863 | [[package]] 864 | name = "lock_api" 865 | version = "0.4.2" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" 868 | dependencies = [ 869 | "scopeguard", 870 | ] 871 | 872 | [[package]] 873 | name = "log" 874 | version = "0.4.14" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 877 | dependencies = [ 878 | "cfg-if 1.0.0", 879 | ] 880 | 881 | [[package]] 882 | name = "matches" 883 | version = "0.1.8" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 886 | 887 | [[package]] 888 | name = "matrixmultiply" 889 | version = "0.2.4" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" 892 | dependencies = [ 893 | "rawpointer", 894 | ] 895 | 896 | [[package]] 897 | name = "memchr" 898 | version = "2.3.4" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" 901 | 902 | [[package]] 903 | name = "memoffset" 904 | version = "0.6.1" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" 907 | dependencies = [ 908 | "autocfg", 909 | ] 910 | 911 | [[package]] 912 | name = "mime" 913 | version = "0.3.16" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 916 | 917 | [[package]] 918 | name = "mime_guess" 919 | version = "2.0.3" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 922 | dependencies = [ 923 | "mime", 924 | "unicase", 925 | ] 926 | 927 | [[package]] 928 | name = "miniz_oxide" 929 | version = "0.3.7" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 932 | dependencies = [ 933 | "adler32", 934 | ] 935 | 936 | [[package]] 937 | name = "mio" 938 | version = "0.7.9" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" 941 | dependencies = [ 942 | "libc", 943 | "log", 944 | "miow", 945 | "ntapi", 946 | "winapi", 947 | ] 948 | 949 | [[package]] 950 | name = "miow" 951 | version = "0.3.6" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" 954 | dependencies = [ 955 | "socket2", 956 | "winapi", 957 | ] 958 | 959 | [[package]] 960 | name = "multipart" 961 | version = "0.17.1" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "d050aeedc89243f5347c3e237e3e13dc76fbe4ae3742a57b94dc14f69acf76d4" 964 | dependencies = [ 965 | "buf_redux", 966 | "httparse", 967 | "log", 968 | "mime", 969 | "mime_guess", 970 | "quick-error", 971 | "rand 0.7.3", 972 | "safemem", 973 | "tempfile", 974 | "twoway", 975 | ] 976 | 977 | [[package]] 978 | name = "nanorand" 979 | version = "0.5.2" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "ac1378b66f7c93a1c0f8464a19bf47df8795083842e5090f4b7305973d5a22d0" 982 | dependencies = [ 983 | "getrandom 0.2.2", 984 | ] 985 | 986 | [[package]] 987 | name = "native-tls" 988 | version = "0.2.7" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" 991 | dependencies = [ 992 | "lazy_static", 993 | "libc", 994 | "log", 995 | "openssl", 996 | "openssl-probe", 997 | "openssl-sys", 998 | "schannel", 999 | "security-framework", 1000 | "security-framework-sys", 1001 | "tempfile", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "ndarray" 1006 | version = "0.13.1" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "ac06db03ec2f46ee0ecdca1a1c34a99c0d188a0d83439b84bf0cb4b386e4ab09" 1009 | dependencies = [ 1010 | "matrixmultiply", 1011 | "num-complex", 1012 | "num-integer", 1013 | "num-traits", 1014 | "rawpointer", 1015 | ] 1016 | 1017 | [[package]] 1018 | name = "ntapi" 1019 | version = "0.3.6" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 1022 | dependencies = [ 1023 | "winapi", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "num-complex" 1028 | version = "0.2.4" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" 1031 | dependencies = [ 1032 | "autocfg", 1033 | "num-traits", 1034 | ] 1035 | 1036 | [[package]] 1037 | name = "num-integer" 1038 | version = "0.1.44" 1039 | source = "registry+https://github.com/rust-lang/crates.io-index" 1040 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 1041 | dependencies = [ 1042 | "autocfg", 1043 | "num-traits", 1044 | ] 1045 | 1046 | [[package]] 1047 | name = "num-traits" 1048 | version = "0.2.14" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 1051 | dependencies = [ 1052 | "autocfg", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "num_cpus" 1057 | version = "1.13.0" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 1060 | dependencies = [ 1061 | "hermit-abi", 1062 | "libc", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "number_prefix" 1067 | version = "0.3.0" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" 1070 | 1071 | [[package]] 1072 | name = "once_cell" 1073 | version = "1.7.2" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" 1076 | 1077 | [[package]] 1078 | name = "opaque-debug" 1079 | version = "0.3.0" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 1082 | 1083 | [[package]] 1084 | name = "openssl" 1085 | version = "0.10.32" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70" 1088 | dependencies = [ 1089 | "bitflags", 1090 | "cfg-if 1.0.0", 1091 | "foreign-types", 1092 | "lazy_static", 1093 | "libc", 1094 | "openssl-sys", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "openssl-probe" 1099 | version = "0.1.2" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 1102 | 1103 | [[package]] 1104 | name = "openssl-sys" 1105 | version = "0.9.60" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" 1108 | dependencies = [ 1109 | "autocfg", 1110 | "cc", 1111 | "libc", 1112 | "pkg-config", 1113 | "vcpkg", 1114 | ] 1115 | 1116 | [[package]] 1117 | name = "ordered-float" 1118 | version = "2.1.1" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "766f840da25490628d8e63e529cd21c014f6600c6b8517add12a6fa6167a6218" 1121 | dependencies = [ 1122 | "num-traits", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "parking_lot" 1127 | version = "0.11.1" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 1130 | dependencies = [ 1131 | "instant", 1132 | "lock_api", 1133 | "parking_lot_core", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "parking_lot_core" 1138 | version = "0.8.3" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" 1141 | dependencies = [ 1142 | "cfg-if 1.0.0", 1143 | "instant", 1144 | "libc", 1145 | "redox_syscall", 1146 | "smallvec", 1147 | "winapi", 1148 | ] 1149 | 1150 | [[package]] 1151 | name = "percent-encoding" 1152 | version = "2.1.0" 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" 1154 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1155 | 1156 | [[package]] 1157 | name = "pin-project" 1158 | version = "1.0.5" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" 1161 | dependencies = [ 1162 | "pin-project-internal", 1163 | ] 1164 | 1165 | [[package]] 1166 | name = "pin-project-internal" 1167 | version = "1.0.5" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" 1170 | dependencies = [ 1171 | "proc-macro2", 1172 | "quote", 1173 | "syn", 1174 | ] 1175 | 1176 | [[package]] 1177 | name = "pin-project-lite" 1178 | version = "0.2.6" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" 1181 | 1182 | [[package]] 1183 | name = "pin-utils" 1184 | version = "0.1.0" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1187 | 1188 | [[package]] 1189 | name = "pkg-config" 1190 | version = "0.3.19" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 1193 | 1194 | [[package]] 1195 | name = "ppv-lite86" 1196 | version = "0.2.10" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 1199 | 1200 | [[package]] 1201 | name = "proc-macro2" 1202 | version = "1.0.24" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 1205 | dependencies = [ 1206 | "unicode-xid", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "protobuf" 1211 | version = "2.18.0" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "6d147edb77bcccbfc81fabffdc7bd50c13e103b15ca1e27515fe40de69a5776b" 1214 | 1215 | [[package]] 1216 | name = "quick-error" 1217 | version = "1.2.3" 1218 | source = "registry+https://github.com/rust-lang/crates.io-index" 1219 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 1220 | 1221 | [[package]] 1222 | name = "quote" 1223 | version = "1.0.9" 1224 | source = "registry+https://github.com/rust-lang/crates.io-index" 1225 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 1226 | dependencies = [ 1227 | "proc-macro2", 1228 | ] 1229 | 1230 | [[package]] 1231 | name = "rand" 1232 | version = "0.7.3" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1235 | dependencies = [ 1236 | "getrandom 0.1.16", 1237 | "libc", 1238 | "rand_chacha 0.2.2", 1239 | "rand_core 0.5.1", 1240 | "rand_hc 0.2.0", 1241 | ] 1242 | 1243 | [[package]] 1244 | name = "rand" 1245 | version = "0.8.3" 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" 1247 | checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" 1248 | dependencies = [ 1249 | "libc", 1250 | "rand_chacha 0.3.0", 1251 | "rand_core 0.6.2", 1252 | "rand_hc 0.3.0", 1253 | ] 1254 | 1255 | [[package]] 1256 | name = "rand_chacha" 1257 | version = "0.2.2" 1258 | source = "registry+https://github.com/rust-lang/crates.io-index" 1259 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1260 | dependencies = [ 1261 | "ppv-lite86", 1262 | "rand_core 0.5.1", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "rand_chacha" 1267 | version = "0.3.0" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" 1270 | dependencies = [ 1271 | "ppv-lite86", 1272 | "rand_core 0.6.2", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "rand_core" 1277 | version = "0.5.1" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1280 | dependencies = [ 1281 | "getrandom 0.1.16", 1282 | ] 1283 | 1284 | [[package]] 1285 | name = "rand_core" 1286 | version = "0.6.2" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" 1289 | dependencies = [ 1290 | "getrandom 0.2.2", 1291 | ] 1292 | 1293 | [[package]] 1294 | name = "rand_hc" 1295 | version = "0.2.0" 1296 | source = "registry+https://github.com/rust-lang/crates.io-index" 1297 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1298 | dependencies = [ 1299 | "rand_core 0.5.1", 1300 | ] 1301 | 1302 | [[package]] 1303 | name = "rand_hc" 1304 | version = "0.3.0" 1305 | source = "registry+https://github.com/rust-lang/crates.io-index" 1306 | checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" 1307 | dependencies = [ 1308 | "rand_core 0.6.2", 1309 | ] 1310 | 1311 | [[package]] 1312 | name = "rawpointer" 1313 | version = "0.2.1" 1314 | source = "registry+https://github.com/rust-lang/crates.io-index" 1315 | checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" 1316 | 1317 | [[package]] 1318 | name = "rayon" 1319 | version = "1.5.0" 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" 1321 | checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" 1322 | dependencies = [ 1323 | "autocfg", 1324 | "crossbeam-deque", 1325 | "either", 1326 | "rayon-core", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "rayon-core" 1331 | version = "1.9.0" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" 1334 | dependencies = [ 1335 | "crossbeam-channel", 1336 | "crossbeam-deque", 1337 | "crossbeam-utils", 1338 | "lazy_static", 1339 | "num_cpus", 1340 | ] 1341 | 1342 | [[package]] 1343 | name = "redox_syscall" 1344 | version = "0.2.5" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" 1347 | dependencies = [ 1348 | "bitflags", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "redox_users" 1353 | version = "0.4.0" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" 1356 | dependencies = [ 1357 | "getrandom 0.2.2", 1358 | "redox_syscall", 1359 | ] 1360 | 1361 | [[package]] 1362 | name = "regex" 1363 | version = "1.4.3" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" 1366 | dependencies = [ 1367 | "aho-corasick", 1368 | "memchr", 1369 | "regex-syntax", 1370 | "thread_local", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "regex-automata" 1375 | version = "0.1.9" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" 1378 | dependencies = [ 1379 | "byteorder", 1380 | ] 1381 | 1382 | [[package]] 1383 | name = "regex-syntax" 1384 | version = "0.6.22" 1385 | source = "registry+https://github.com/rust-lang/crates.io-index" 1386 | checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" 1387 | 1388 | [[package]] 1389 | name = "remove_dir_all" 1390 | version = "0.5.3" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1393 | dependencies = [ 1394 | "winapi", 1395 | ] 1396 | 1397 | [[package]] 1398 | name = "reqwest" 1399 | version = "0.11.1" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "0460542b551950620a3648c6aa23318ac6b3cd779114bd873209e6e8b5eb1c34" 1402 | dependencies = [ 1403 | "base64", 1404 | "bytes", 1405 | "encoding_rs", 1406 | "futures-core", 1407 | "futures-util", 1408 | "http", 1409 | "http-body", 1410 | "hyper", 1411 | "hyper-tls", 1412 | "ipnet", 1413 | "js-sys", 1414 | "lazy_static", 1415 | "log", 1416 | "mime", 1417 | "native-tls", 1418 | "percent-encoding", 1419 | "pin-project-lite", 1420 | "serde", 1421 | "serde_urlencoded", 1422 | "tokio", 1423 | "tokio-native-tls", 1424 | "url", 1425 | "wasm-bindgen", 1426 | "wasm-bindgen-futures", 1427 | "web-sys", 1428 | "winreg", 1429 | ] 1430 | 1431 | [[package]] 1432 | name = "rust-bert" 1433 | version = "0.14.0" 1434 | source = "registry+https://github.com/rust-lang/crates.io-index" 1435 | checksum = "f476f93bfaacec20881a3a4c52a798d12ff1355157afc423f5337a2fa86217f4" 1436 | dependencies = [ 1437 | "cached-path", 1438 | "dirs 3.0.2", 1439 | "itertools 0.10.0", 1440 | "lazy_static", 1441 | "ordered-float", 1442 | "rust_tokenizers", 1443 | "serde", 1444 | "serde_json", 1445 | "tch", 1446 | "thiserror", 1447 | "uuid", 1448 | ] 1449 | 1450 | [[package]] 1451 | name = "rust_tokenizers" 1452 | version = "6.2.1" 1453 | source = "registry+https://github.com/rust-lang/crates.io-index" 1454 | checksum = "61f0896b5b81ff11d4834fea745bbfe52487c06293b9a96ff12e50e7566808be" 1455 | dependencies = [ 1456 | "csv", 1457 | "hashbrown", 1458 | "itertools 0.9.0", 1459 | "lazy_static", 1460 | "protobuf", 1461 | "rayon", 1462 | "regex", 1463 | "serde", 1464 | "serde_json", 1465 | "thiserror", 1466 | "unicode-normalization", 1467 | "unicode-normalization-alignments", 1468 | ] 1469 | 1470 | [[package]] 1471 | name = "ryu" 1472 | version = "1.0.5" 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" 1474 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1475 | 1476 | [[package]] 1477 | name = "safemem" 1478 | version = "0.3.3" 1479 | source = "registry+https://github.com/rust-lang/crates.io-index" 1480 | checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" 1481 | 1482 | [[package]] 1483 | name = "schannel" 1484 | version = "0.1.19" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 1487 | dependencies = [ 1488 | "lazy_static", 1489 | "winapi", 1490 | ] 1491 | 1492 | [[package]] 1493 | name = "scoped-tls" 1494 | version = "1.0.0" 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" 1496 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1497 | 1498 | [[package]] 1499 | name = "scopeguard" 1500 | version = "1.1.0" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1503 | 1504 | [[package]] 1505 | name = "security-framework" 1506 | version = "2.1.1" 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" 1508 | checksum = "2dfd318104249865096c8da1dfabf09ddbb6d0330ea176812a62ec75e40c4166" 1509 | dependencies = [ 1510 | "bitflags", 1511 | "core-foundation", 1512 | "core-foundation-sys", 1513 | "libc", 1514 | "security-framework-sys", 1515 | ] 1516 | 1517 | [[package]] 1518 | name = "security-framework-sys" 1519 | version = "2.1.1" 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" 1521 | checksum = "dee48cdde5ed250b0d3252818f646e174ab414036edb884dde62d80a3ac6082d" 1522 | dependencies = [ 1523 | "core-foundation-sys", 1524 | "libc", 1525 | ] 1526 | 1527 | [[package]] 1528 | name = "serde" 1529 | version = "1.0.127" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" 1532 | dependencies = [ 1533 | "serde_derive", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "serde_derive" 1538 | version = "1.0.127" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" 1541 | dependencies = [ 1542 | "proc-macro2", 1543 | "quote", 1544 | "syn", 1545 | ] 1546 | 1547 | [[package]] 1548 | name = "serde_json" 1549 | version = "1.0.64" 1550 | source = "registry+https://github.com/rust-lang/crates.io-index" 1551 | checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" 1552 | dependencies = [ 1553 | "itoa", 1554 | "ryu", 1555 | "serde", 1556 | ] 1557 | 1558 | [[package]] 1559 | name = "serde_urlencoded" 1560 | version = "0.7.0" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 1563 | dependencies = [ 1564 | "form_urlencoded", 1565 | "itoa", 1566 | "ryu", 1567 | "serde", 1568 | ] 1569 | 1570 | [[package]] 1571 | name = "sha-1" 1572 | version = "0.9.4" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" 1575 | dependencies = [ 1576 | "block-buffer", 1577 | "cfg-if 1.0.0", 1578 | "cpuid-bool", 1579 | "digest", 1580 | "opaque-debug", 1581 | ] 1582 | 1583 | [[package]] 1584 | name = "sha2" 1585 | version = "0.9.3" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" 1588 | dependencies = [ 1589 | "block-buffer", 1590 | "cfg-if 1.0.0", 1591 | "cpuid-bool", 1592 | "digest", 1593 | "opaque-debug", 1594 | ] 1595 | 1596 | [[package]] 1597 | name = "signal-hook-registry" 1598 | version = "1.3.0" 1599 | source = "registry+https://github.com/rust-lang/crates.io-index" 1600 | checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" 1601 | dependencies = [ 1602 | "libc", 1603 | ] 1604 | 1605 | [[package]] 1606 | name = "slab" 1607 | version = "0.4.2" 1608 | source = "registry+https://github.com/rust-lang/crates.io-index" 1609 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1610 | 1611 | [[package]] 1612 | name = "smallvec" 1613 | version = "1.6.1" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 1616 | 1617 | [[package]] 1618 | name = "socket2" 1619 | version = "0.3.19" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" 1622 | dependencies = [ 1623 | "cfg-if 1.0.0", 1624 | "libc", 1625 | "winapi", 1626 | ] 1627 | 1628 | [[package]] 1629 | name = "spinning_top" 1630 | version = "0.2.2" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "7e529d73e80d64b5f2631f9035113347c578a1c9c7774b83a2b880788459ab36" 1633 | dependencies = [ 1634 | "lock_api", 1635 | ] 1636 | 1637 | [[package]] 1638 | name = "syn" 1639 | version = "1.0.62" 1640 | source = "registry+https://github.com/rust-lang/crates.io-index" 1641 | checksum = "123a78a3596b24fee53a6464ce52d8ecbf62241e6294c7e7fe12086cd161f512" 1642 | dependencies = [ 1643 | "proc-macro2", 1644 | "quote", 1645 | "unicode-xid", 1646 | ] 1647 | 1648 | [[package]] 1649 | name = "tar" 1650 | version = "0.4.33" 1651 | source = "registry+https://github.com/rust-lang/crates.io-index" 1652 | checksum = "c0bcfbd6a598361fda270d82469fff3d65089dc33e175c9a131f7b4cd395f228" 1653 | dependencies = [ 1654 | "filetime", 1655 | "libc", 1656 | "xattr", 1657 | ] 1658 | 1659 | [[package]] 1660 | name = "tch" 1661 | version = "0.3.1" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "8fec1d5951adaf4e2de38a094aedf98d44ae0a2e50e6bd7c924f798e0ca944f3" 1664 | dependencies = [ 1665 | "half", 1666 | "lazy_static", 1667 | "libc", 1668 | "ndarray", 1669 | "rand 0.7.3", 1670 | "thiserror", 1671 | "torch-sys", 1672 | "zip", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "tempfile" 1677 | version = "3.2.0" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" 1680 | dependencies = [ 1681 | "cfg-if 1.0.0", 1682 | "libc", 1683 | "rand 0.8.3", 1684 | "redox_syscall", 1685 | "remove_dir_all", 1686 | "winapi", 1687 | ] 1688 | 1689 | [[package]] 1690 | name = "termcolor" 1691 | version = "1.1.2" 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" 1693 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 1694 | dependencies = [ 1695 | "winapi-util", 1696 | ] 1697 | 1698 | [[package]] 1699 | name = "terminal_size" 1700 | version = "0.1.16" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "86ca8ced750734db02076f44132d802af0b33b09942331f4459dde8636fd2406" 1703 | dependencies = [ 1704 | "libc", 1705 | "winapi", 1706 | ] 1707 | 1708 | [[package]] 1709 | name = "thiserror" 1710 | version = "1.0.24" 1711 | source = "registry+https://github.com/rust-lang/crates.io-index" 1712 | checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" 1713 | dependencies = [ 1714 | "thiserror-impl", 1715 | ] 1716 | 1717 | [[package]] 1718 | name = "thiserror-impl" 1719 | version = "1.0.24" 1720 | source = "registry+https://github.com/rust-lang/crates.io-index" 1721 | checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" 1722 | dependencies = [ 1723 | "proc-macro2", 1724 | "quote", 1725 | "syn", 1726 | ] 1727 | 1728 | [[package]] 1729 | name = "thread_local" 1730 | version = "1.1.3" 1731 | source = "registry+https://github.com/rust-lang/crates.io-index" 1732 | checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" 1733 | dependencies = [ 1734 | "once_cell", 1735 | ] 1736 | 1737 | [[package]] 1738 | name = "time" 1739 | version = "0.1.43" 1740 | source = "registry+https://github.com/rust-lang/crates.io-index" 1741 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 1742 | dependencies = [ 1743 | "libc", 1744 | "winapi", 1745 | ] 1746 | 1747 | [[package]] 1748 | name = "tinyvec" 1749 | version = "1.1.1" 1750 | source = "registry+https://github.com/rust-lang/crates.io-index" 1751 | checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" 1752 | dependencies = [ 1753 | "tinyvec_macros", 1754 | ] 1755 | 1756 | [[package]] 1757 | name = "tinyvec_macros" 1758 | version = "0.1.0" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1761 | 1762 | [[package]] 1763 | name = "tokio" 1764 | version = "1.14.0" 1765 | source = "registry+https://github.com/rust-lang/crates.io-index" 1766 | checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" 1767 | dependencies = [ 1768 | "autocfg", 1769 | "bytes", 1770 | "libc", 1771 | "memchr", 1772 | "mio", 1773 | "num_cpus", 1774 | "once_cell", 1775 | "parking_lot", 1776 | "pin-project-lite", 1777 | "signal-hook-registry", 1778 | "tokio-macros", 1779 | "winapi", 1780 | ] 1781 | 1782 | [[package]] 1783 | name = "tokio-macros" 1784 | version = "1.6.0" 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" 1786 | checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e" 1787 | dependencies = [ 1788 | "proc-macro2", 1789 | "quote", 1790 | "syn", 1791 | ] 1792 | 1793 | [[package]] 1794 | name = "tokio-native-tls" 1795 | version = "0.3.0" 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" 1797 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1798 | dependencies = [ 1799 | "native-tls", 1800 | "tokio", 1801 | ] 1802 | 1803 | [[package]] 1804 | name = "tokio-stream" 1805 | version = "0.1.3" 1806 | source = "registry+https://github.com/rust-lang/crates.io-index" 1807 | checksum = "1981ad97df782ab506a1f43bf82c967326960d278acf3bf8279809648c3ff3ea" 1808 | dependencies = [ 1809 | "futures-core", 1810 | "pin-project-lite", 1811 | "tokio", 1812 | ] 1813 | 1814 | [[package]] 1815 | name = "tokio-tungstenite" 1816 | version = "0.13.0" 1817 | source = "registry+https://github.com/rust-lang/crates.io-index" 1818 | checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" 1819 | dependencies = [ 1820 | "futures-util", 1821 | "log", 1822 | "pin-project", 1823 | "tokio", 1824 | "tungstenite", 1825 | ] 1826 | 1827 | [[package]] 1828 | name = "tokio-util" 1829 | version = "0.6.3" 1830 | source = "registry+https://github.com/rust-lang/crates.io-index" 1831 | checksum = "ebb7cb2f00c5ae8df755b252306272cd1790d39728363936e01827e11f0b017b" 1832 | dependencies = [ 1833 | "bytes", 1834 | "futures-core", 1835 | "futures-sink", 1836 | "log", 1837 | "pin-project-lite", 1838 | "tokio", 1839 | ] 1840 | 1841 | [[package]] 1842 | name = "torch-sys" 1843 | version = "0.3.1" 1844 | source = "registry+https://github.com/rust-lang/crates.io-index" 1845 | checksum = "8354bdb8a9f50da96c0eda743c7bccc747a319294d3ed3ffbce6f9ea2cea68da" 1846 | dependencies = [ 1847 | "anyhow", 1848 | "cc", 1849 | "cmake", 1850 | "curl", 1851 | "libc", 1852 | "zip", 1853 | ] 1854 | 1855 | [[package]] 1856 | name = "tower-service" 1857 | version = "0.3.1" 1858 | source = "registry+https://github.com/rust-lang/crates.io-index" 1859 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 1860 | 1861 | [[package]] 1862 | name = "tracing" 1863 | version = "0.1.25" 1864 | source = "registry+https://github.com/rust-lang/crates.io-index" 1865 | checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" 1866 | dependencies = [ 1867 | "cfg-if 1.0.0", 1868 | "log", 1869 | "pin-project-lite", 1870 | "tracing-core", 1871 | ] 1872 | 1873 | [[package]] 1874 | name = "tracing-core" 1875 | version = "0.1.17" 1876 | source = "registry+https://github.com/rust-lang/crates.io-index" 1877 | checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" 1878 | dependencies = [ 1879 | "lazy_static", 1880 | ] 1881 | 1882 | [[package]] 1883 | name = "try-lock" 1884 | version = "0.2.3" 1885 | source = "registry+https://github.com/rust-lang/crates.io-index" 1886 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1887 | 1888 | [[package]] 1889 | name = "tungstenite" 1890 | version = "0.12.0" 1891 | source = "registry+https://github.com/rust-lang/crates.io-index" 1892 | checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" 1893 | dependencies = [ 1894 | "base64", 1895 | "byteorder", 1896 | "bytes", 1897 | "http", 1898 | "httparse", 1899 | "input_buffer", 1900 | "log", 1901 | "rand 0.8.3", 1902 | "sha-1", 1903 | "url", 1904 | "utf-8", 1905 | ] 1906 | 1907 | [[package]] 1908 | name = "twoway" 1909 | version = "0.1.8" 1910 | source = "registry+https://github.com/rust-lang/crates.io-index" 1911 | checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" 1912 | dependencies = [ 1913 | "memchr", 1914 | ] 1915 | 1916 | [[package]] 1917 | name = "typenum" 1918 | version = "1.12.0" 1919 | source = "registry+https://github.com/rust-lang/crates.io-index" 1920 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 1921 | 1922 | [[package]] 1923 | name = "unicase" 1924 | version = "2.6.0" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1927 | dependencies = [ 1928 | "version_check", 1929 | ] 1930 | 1931 | [[package]] 1932 | name = "unicode-bidi" 1933 | version = "0.3.4" 1934 | source = "registry+https://github.com/rust-lang/crates.io-index" 1935 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1936 | dependencies = [ 1937 | "matches", 1938 | ] 1939 | 1940 | [[package]] 1941 | name = "unicode-normalization" 1942 | version = "0.1.17" 1943 | source = "registry+https://github.com/rust-lang/crates.io-index" 1944 | checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" 1945 | dependencies = [ 1946 | "tinyvec", 1947 | ] 1948 | 1949 | [[package]] 1950 | name = "unicode-normalization-alignments" 1951 | version = "0.1.12" 1952 | source = "registry+https://github.com/rust-lang/crates.io-index" 1953 | checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" 1954 | dependencies = [ 1955 | "smallvec", 1956 | ] 1957 | 1958 | [[package]] 1959 | name = "unicode-width" 1960 | version = "0.1.8" 1961 | source = "registry+https://github.com/rust-lang/crates.io-index" 1962 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 1963 | 1964 | [[package]] 1965 | name = "unicode-xid" 1966 | version = "0.2.1" 1967 | source = "registry+https://github.com/rust-lang/crates.io-index" 1968 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 1969 | 1970 | [[package]] 1971 | name = "url" 1972 | version = "2.2.1" 1973 | source = "registry+https://github.com/rust-lang/crates.io-index" 1974 | checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" 1975 | dependencies = [ 1976 | "form_urlencoded", 1977 | "idna", 1978 | "matches", 1979 | "percent-encoding", 1980 | ] 1981 | 1982 | [[package]] 1983 | name = "utf-8" 1984 | version = "0.7.5" 1985 | source = "registry+https://github.com/rust-lang/crates.io-index" 1986 | checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" 1987 | 1988 | [[package]] 1989 | name = "uuid" 1990 | version = "0.8.2" 1991 | source = "registry+https://github.com/rust-lang/crates.io-index" 1992 | checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" 1993 | dependencies = [ 1994 | "getrandom 0.2.2", 1995 | ] 1996 | 1997 | [[package]] 1998 | name = "vcpkg" 1999 | version = "0.2.11" 2000 | source = "registry+https://github.com/rust-lang/crates.io-index" 2001 | checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" 2002 | 2003 | [[package]] 2004 | name = "version_check" 2005 | version = "0.9.2" 2006 | source = "registry+https://github.com/rust-lang/crates.io-index" 2007 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 2008 | 2009 | [[package]] 2010 | name = "want" 2011 | version = "0.3.0" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 2014 | dependencies = [ 2015 | "log", 2016 | "try-lock", 2017 | ] 2018 | 2019 | [[package]] 2020 | name = "warp" 2021 | version = "0.3.1" 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" 2023 | checksum = "332d47745e9a0c38636dbd454729b147d16bd1ed08ae67b3ab281c4506771054" 2024 | dependencies = [ 2025 | "bytes", 2026 | "futures", 2027 | "headers", 2028 | "http", 2029 | "hyper", 2030 | "log", 2031 | "mime", 2032 | "mime_guess", 2033 | "multipart", 2034 | "percent-encoding", 2035 | "pin-project", 2036 | "scoped-tls", 2037 | "serde", 2038 | "serde_json", 2039 | "serde_urlencoded", 2040 | "tokio", 2041 | "tokio-stream", 2042 | "tokio-tungstenite", 2043 | "tokio-util", 2044 | "tower-service", 2045 | "tracing", 2046 | ] 2047 | 2048 | [[package]] 2049 | name = "wasi" 2050 | version = "0.9.0+wasi-snapshot-preview1" 2051 | source = "registry+https://github.com/rust-lang/crates.io-index" 2052 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2053 | 2054 | [[package]] 2055 | name = "wasi" 2056 | version = "0.10.2+wasi-snapshot-preview1" 2057 | source = "registry+https://github.com/rust-lang/crates.io-index" 2058 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 2059 | 2060 | [[package]] 2061 | name = "wasm-bindgen" 2062 | version = "0.2.71" 2063 | source = "registry+https://github.com/rust-lang/crates.io-index" 2064 | checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" 2065 | dependencies = [ 2066 | "cfg-if 1.0.0", 2067 | "serde", 2068 | "serde_json", 2069 | "wasm-bindgen-macro", 2070 | ] 2071 | 2072 | [[package]] 2073 | name = "wasm-bindgen-backend" 2074 | version = "0.2.71" 2075 | source = "registry+https://github.com/rust-lang/crates.io-index" 2076 | checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" 2077 | dependencies = [ 2078 | "bumpalo", 2079 | "lazy_static", 2080 | "log", 2081 | "proc-macro2", 2082 | "quote", 2083 | "syn", 2084 | "wasm-bindgen-shared", 2085 | ] 2086 | 2087 | [[package]] 2088 | name = "wasm-bindgen-futures" 2089 | version = "0.4.21" 2090 | source = "registry+https://github.com/rust-lang/crates.io-index" 2091 | checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" 2092 | dependencies = [ 2093 | "cfg-if 1.0.0", 2094 | "js-sys", 2095 | "wasm-bindgen", 2096 | "web-sys", 2097 | ] 2098 | 2099 | [[package]] 2100 | name = "wasm-bindgen-macro" 2101 | version = "0.2.71" 2102 | source = "registry+https://github.com/rust-lang/crates.io-index" 2103 | checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" 2104 | dependencies = [ 2105 | "quote", 2106 | "wasm-bindgen-macro-support", 2107 | ] 2108 | 2109 | [[package]] 2110 | name = "wasm-bindgen-macro-support" 2111 | version = "0.2.71" 2112 | source = "registry+https://github.com/rust-lang/crates.io-index" 2113 | checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" 2114 | dependencies = [ 2115 | "proc-macro2", 2116 | "quote", 2117 | "syn", 2118 | "wasm-bindgen-backend", 2119 | "wasm-bindgen-shared", 2120 | ] 2121 | 2122 | [[package]] 2123 | name = "wasm-bindgen-shared" 2124 | version = "0.2.71" 2125 | source = "registry+https://github.com/rust-lang/crates.io-index" 2126 | checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" 2127 | 2128 | [[package]] 2129 | name = "web-sys" 2130 | version = "0.3.48" 2131 | source = "registry+https://github.com/rust-lang/crates.io-index" 2132 | checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" 2133 | dependencies = [ 2134 | "js-sys", 2135 | "wasm-bindgen", 2136 | ] 2137 | 2138 | [[package]] 2139 | name = "winapi" 2140 | version = "0.3.9" 2141 | source = "registry+https://github.com/rust-lang/crates.io-index" 2142 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2143 | dependencies = [ 2144 | "winapi-i686-pc-windows-gnu", 2145 | "winapi-x86_64-pc-windows-gnu", 2146 | ] 2147 | 2148 | [[package]] 2149 | name = "winapi-i686-pc-windows-gnu" 2150 | version = "0.4.0" 2151 | source = "registry+https://github.com/rust-lang/crates.io-index" 2152 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2153 | 2154 | [[package]] 2155 | name = "winapi-util" 2156 | version = "0.1.5" 2157 | source = "registry+https://github.com/rust-lang/crates.io-index" 2158 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2159 | dependencies = [ 2160 | "winapi", 2161 | ] 2162 | 2163 | [[package]] 2164 | name = "winapi-x86_64-pc-windows-gnu" 2165 | version = "0.4.0" 2166 | source = "registry+https://github.com/rust-lang/crates.io-index" 2167 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2168 | 2169 | [[package]] 2170 | name = "winreg" 2171 | version = "0.7.0" 2172 | source = "registry+https://github.com/rust-lang/crates.io-index" 2173 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 2174 | dependencies = [ 2175 | "winapi", 2176 | ] 2177 | 2178 | [[package]] 2179 | name = "xattr" 2180 | version = "0.2.2" 2181 | source = "registry+https://github.com/rust-lang/crates.io-index" 2182 | checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" 2183 | dependencies = [ 2184 | "libc", 2185 | ] 2186 | 2187 | [[package]] 2188 | name = "zip" 2189 | version = "0.5.11" 2190 | source = "registry+https://github.com/rust-lang/crates.io-index" 2191 | checksum = "8264fcea9b7a036a4a5103d7153e988dbc2ebbafb34f68a3c2d404b6b82d74b6" 2192 | dependencies = [ 2193 | "byteorder", 2194 | "bzip2", 2195 | "crc32fast", 2196 | "flate2", 2197 | "thiserror", 2198 | "time", 2199 | ] 2200 | 2201 | [[package]] 2202 | name = "zip-extensions" 2203 | version = "0.6.0" 2204 | source = "registry+https://github.com/rust-lang/crates.io-index" 2205 | checksum = "6b9397aa85b738c68f94ca15ee7168a8d46c664e408f2a456d623f7a55384891" 2206 | dependencies = [ 2207 | "zip", 2208 | ] 2209 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dl-webserver" 3 | version = "0.1.0" 4 | authors = ["epwalsh "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | batched-fn = { version = "0.2.3" } 9 | tokio = { version = "1.14.0", features = ["full"] } 10 | warp = "0.3.1" 11 | tch = "0.3.1" 12 | rust-bert = "0.14.0" 13 | env_logger = "0.9.0" 14 | log = "0.4" 15 | serde = "1.0" 16 | dirs = "4.0" 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cargo helpers. 3 | # 4 | 5 | LIBTORCH=~/torch/libtorch 6 | 7 | 8 | .PHONY : run 9 | 10 | ifneq ($(wildcard $(LIBTORCH)),) 11 | LIBTORCH_PATH=$(shell realpath $(LIBTORCH)) 12 | LD_LIBRARY_PATH=$(LIBTORCH_PATH)/lib 13 | 14 | run : 15 | LIBTORCH=$(LIBTORCH) \ 16 | LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \ 17 | cargo run 18 | else 19 | run : 20 | @echo "No LIBTORCH found, GPU won't be available" 21 | cargo run 22 | endif 23 | 24 | .PHONY : build 25 | build : 26 | cargo build 27 | 28 | .PHONY : format 29 | format : 30 | cargo fmt -- 31 | 32 | 33 | .PHONY : lint 34 | lint : 35 | cargo fmt --all -- --check 36 | cargo clippy --all-targets --all-features -- \ 37 | -D warnings \ 38 | -A clippy::let_and_return \ 39 | -A clippy::redundant_clone 40 | 41 | .PHONY : test 42 | test : 43 | @cargo test 44 | 45 | .PHONY : doc 46 | doc : 47 | cargo doc 48 | 49 | .PHONY : post 50 | post : 51 | curl \ 52 | -v \ 53 | -d '{"text":"Hello, World!"}' \ 54 | -H "Content-Type: application/json" \ 55 | http://localhost:3030/generate 56 | 57 | .PHONY : post-many 58 | post-many : 59 | curl \ 60 | -s \ 61 | -S \ 62 | -d '{"text":"Hello, World!"}' \ 63 | -H "Content-Type: application/json" \ 64 | http://localhost:3030/generate > /dev/null & 65 | curl \ 66 | -s \ 67 | -S \ 68 | -d '{"text":"Stay at home"}' \ 69 | -H "Content-Type: application/json" \ 70 | http://localhost:3030/generate > /dev/null & 71 | curl \ 72 | -s \ 73 | -S \ 74 | -d '{"text":"Wash your hands"}' \ 75 | -H "Content-Type: application/json" \ 76 | http://localhost:3030/generate > /dev/null & 77 | curl \ 78 | -s \ 79 | -S \ 80 | -d '{"text":"Do not touch your face"}' \ 81 | -H "Content-Type: application/json" \ 82 | http://localhost:3030/generate > /dev/null & 83 | 84 | # 85 | # Git helpers. 86 | # 87 | 88 | .PHONY: create-branch 89 | create-branch : 90 | ifneq ($(issue),) 91 | git checkout -b ISSUE-$(issue) 92 | git push --set-upstream origin $$(git branch | grep \* | cut -d ' ' -f2) 93 | else ifneq ($(name),) 94 | git checkout -b $(name) 95 | git push --set-upstream origin $$(git branch | grep \* | cut -d ' ' -f2) 96 | else 97 | $(error must supply 'issue' or 'name' parameter) 98 | endif 99 | 100 | .PHONY : delete-branch 101 | delete-branch : 102 | @BRANCH=`git rev-parse --abbrev-ref HEAD` \ 103 | && [ $$BRANCH != 'master' ] \ 104 | && echo "On branch $$BRANCH" \ 105 | && echo "Checking out master" \ 106 | && git checkout master \ 107 | && git pull \ 108 | && echo "Deleting branch $$BRANCH" \ 109 | && git branch -d $$BRANCH \ 110 | && git remote prune origin 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-dl-webserver 2 | 3 | This project provides an example of serving a deep learning model with batched prediction using Rust. 4 | In particular it runs a GPT2 model from [rust-bert](https://github.com/guillaume-be/rust-bert) to generate text based on input context. 5 | 6 | ## Features 7 | 8 | - Batched prediction using [`batched-fn`](https://github.com/epwalsh/batched-fn) when GPU is detected. 9 | - Back pressure mechanism that will return a 503 status code if the server gets back-logged with too many requests. 10 | 11 | ## Running the server 12 | 13 | In order for the server to make use of your GPU (if you have one available) you'll need to compile it against the right 14 | version of the LibTorch C++ library, which you can download from 15 | [https://pytorch.org/get-started/locally/](https://pytorch.org/get-started/locally/). 16 | 17 | After downloading, unzip the file and then run the server with 18 | 19 | ```bash 20 | make run LIBTORCH=/path/to/libtorch 21 | ``` 22 | 23 | If you don't have a GPU available, just run 24 | 25 | ```bash 26 | make run 27 | ``` 28 | 29 | Now in a separate terminal you can send several requests in to the server at once: 30 | 31 | ```bash 32 | curl -d '{"text":"Hello, World!"}' \ 33 | -H "Content-Type: application/json" \ 34 | http://localhost:3030/generate & 35 | curl -d '{"text":"Stay at home"}' \ 36 | -H "Content-Type: application/json" \ 37 | http://localhost:3030/generate & 38 | curl -d '{"text":"Wash your hands"}' \ 39 | -H "Content-Type: application/json" \ 40 | http://localhost:3030/generate & 41 | curl -d '{"text":"Do not touch your face"}' \ 42 | -H "Content-Type: application/json" \ 43 | http://localhost:3030/generate & 44 | ``` 45 | 46 | The logs from the server should look something like this: 47 | 48 | ![server output](img/server_output.png) 49 | -------------------------------------------------------------------------------- /img/server_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epwalsh/rust-dl-webserver/0464ab757cdd385ffd05a30c66f303325828c734/img/server_output.png -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use batched_fn::batched_fn; 2 | use env_logger::Env; 3 | use log::{error, info}; 4 | use rust_bert::pipelines::text_generation::{TextGenerationConfig, TextGenerationModel}; 5 | use serde::{Deserialize, Serialize}; 6 | use std::convert::Infallible; 7 | use tch::{Cuda, Device}; 8 | use warp::{http::StatusCode, reject::Reject, Filter, Rejection}; 9 | 10 | #[derive(Debug, Deserialize, Serialize)] 11 | struct Context { 12 | text: String, 13 | } 14 | 15 | async fn generate(context: Context) -> Result { 16 | info!("Received input context: {:?}", context); 17 | 18 | // Using the `batched_fn` macro, we run the model in a separate thread and 19 | // batch input `Context`s together to make better use of the GPU. 20 | // 21 | // NOTE: this is only more efficient if you have a GPU. If serving the model 22 | // on CPU this just adds overhead. 23 | let batched_generate = batched_fn! { 24 | handler = |batch: Vec, model: &TextGenerationModel| -> Vec { 25 | info!("Running batch of size {}", batch.len()); 26 | model.generate( 27 | batch.iter().map(|c| &c.text[..]).collect::>(), 28 | None, 29 | ) 30 | }; 31 | config = { 32 | max_batch_size: if Cuda::cudnn_is_available() { 4 } else { 1 }, 33 | max_delay: 100, 34 | channel_cap: Some(20), 35 | }; 36 | context = { 37 | model: { 38 | info!("Loading model..."); 39 | let device = Device::cuda_if_available(); 40 | let generate_config = TextGenerationConfig { 41 | max_length: 30, 42 | do_sample: true, 43 | num_beams: 5, 44 | temperature: 1.1, 45 | num_return_sequences: 1, 46 | device, 47 | ..Default::default() 48 | }; 49 | let model = TextGenerationModel::new(generate_config).unwrap(); 50 | info!("...model loaded"); 51 | model 52 | }, 53 | }; 54 | }; 55 | 56 | batched_generate(context) 57 | .await 58 | .map(|output| { 59 | // Remove new lines in the generated text to make more readable. 60 | let formatted = output.replace('\n', " "); 61 | info!("Generated output: '{}'", formatted); 62 | formatted 63 | }) 64 | .map_err(|e| match e { 65 | batched_fn::Error::Full => { 66 | error!("At capacity!"); 67 | warp::reject::custom(CapacityFullError) 68 | } 69 | _ => { 70 | // This should only happen if the handler thread crashed. 71 | panic!("{:?}", e); 72 | } 73 | }) 74 | } 75 | 76 | #[derive(Debug)] 77 | struct CapacityFullError; 78 | 79 | impl Reject for CapacityFullError {} 80 | 81 | async fn handle_rejection(err: Rejection) -> Result { 82 | let code; 83 | let message; 84 | 85 | if err.is_not_found() { 86 | code = StatusCode::NOT_FOUND; 87 | message = "NOT_FOUND"; 88 | } else if let Some(CapacityFullError) = err.find() { 89 | code = StatusCode::SERVICE_UNAVAILABLE; 90 | message = "AT_CAPACITY"; 91 | } else if err.find::().is_some() { 92 | // We can handle a specific error, here METHOD_NOT_ALLOWED, 93 | // and render it however we want 94 | code = StatusCode::METHOD_NOT_ALLOWED; 95 | message = "METHOD_NOT_ALLOWED"; 96 | } else { 97 | // We should have expected this... Just log and say its a 500 98 | error!("unhandled rejection: {:?}", err); 99 | code = StatusCode::INTERNAL_SERVER_ERROR; 100 | message = "UNHANDLED_REJECTION"; 101 | } 102 | 103 | Ok(warp::reply::with_status(message, code)) 104 | } 105 | 106 | #[tokio::main] 107 | async fn main() { 108 | env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); 109 | 110 | info!("Cuda available? {}", Cuda::cudnn_is_available()); 111 | 112 | // POST /generate/ {"context":"Hello, World!"} 113 | let routes = warp::post() 114 | .and(warp::path("generate")) 115 | // Only accept bodies smaller than 16kb. 116 | .and(warp::body::content_length_limit(1024 * 16)) 117 | .and(warp::body::json()) 118 | .and_then(generate) 119 | .recover(handle_rejection); 120 | 121 | warp::serve(routes).run(([127, 0, 0, 1], 3030)).await; 122 | } 123 | --------------------------------------------------------------------------------