Skip to content

Commit

Permalink
remove bert
Browse files Browse the repository at this point in the history
  • Loading branch information
ppodolsky committed Jun 23, 2023
1 parent 478bab4 commit e740e50
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 66 deletions.
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ FROM --platform=$BUILDPLATFORM rust as builder
RUN apt-get update && apt-get install -y \
g++-x86-64-linux-gnu libc6-dev-amd64-cross \
g++-aarch64-linux-gnu libc6-dev-arm64-cross \
g++-arm-linux-gnueabihf libc6-dev-armhf-cross \
python3 python3-pip && \
g++-arm-linux-gnueabihf libc6-dev-armhf-cross && \
rm -rf /var/lib/apt/lists/*
RUN rustup target add \
x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu armv7-unknown-linux-gnueabihf
RUN rustup toolchain install \
stable-x86_64-unknown-linux-gnu stable-aarch64-unknown-linux-gnu stable-armv7-unknown-linux-gnueabihf
RUN rustup component add rustfmt
RUN pip3 install torch==2.0.0
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc \
CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++ \
Expand All @@ -21,9 +19,6 @@ ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \
CARGO_INCREMENTAL=0 \
LIBTORCH=/usr/local/lib/python3.9/dist-packages/torch \
LIBTORCH_CXX11_ABI=0 \
DYLD_LIBRARY_PATH=/usr/local/lib/python3.9/dist-packages/torch/lib

FROM --platform=$BUILDPLATFORM builder AS base-dir
WORKDIR /app
Expand Down Expand Up @@ -57,17 +52,13 @@ RUN mv target/armv7-unknown-linux-gnueabihf/release/summa-server-bin /bin/summa-
# Final arch images ----------------------
FROM --platform=amd64 gcr.io/distroless/cc AS final-amd64
COPY --from=build-amd64 /bin/summa-server /bin/summa-server
COPY --from=build-amd64 /usr/local/lib /usr/local/lib

FROM --platform=arm64 gcr.io/distroless/cc:latest-arm64 AS final-arm64
COPY --from=build-arm64 /bin/summa-server /bin/summa-server
COPY --from=build-arm64 /usr/local/lib /usr/local/lib

FROM --platform=arm/v7 gcr.io/distroless/cc:latest-arm AS final-arm
COPY --from=build-arm /bin/summa-server /bin/summa-server
COPY --from=build-arm /usr/local/lib /usr/local/lib

# Final image ----------------------------
FROM final-${TARGETARCH}
ENV LD_LIBRARY_PATH=/usr/local/lib/python3.9/dist-packages/torch/lib/
ENTRYPOINT ["/bin/summa-server"]
2 changes: 0 additions & 2 deletions summa-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ doc = true
fs = ["tantivy/mmap", "tokio/fs"]
hyper-external-request = ["hyper", "hyper-tls"]
metrics = ["opentelemetry"]
nn = ["rust-bert"]
tokio-rt = ["tokio/rt"]

[dev-dependencies]
Expand Down Expand Up @@ -47,7 +46,6 @@ prost = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
rust-bert = { version = "0.21", optional = true }
rustc-hash = "1.1.0"
serde = { workspace = true }
serde_bytes = { workspace = true }
Expand Down
47 changes: 0 additions & 47 deletions summa-core/src/components/query_parser/morphology/english_nn.rs

This file was deleted.

3 changes: 0 additions & 3 deletions summa-core/src/components/query_parser/morphology/manager.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::collections::HashMap;

#[cfg(not(feature = "nn"))]
use crate::components::query_parser::morphology::english::EnglishMorphology;
#[cfg(feature = "nn")]
use crate::components::query_parser::morphology::english_nn::EnglishNNMorphology as EnglishMorphology;
use crate::components::query_parser::morphology::Morphology;

#[derive(Clone)]
Expand Down
2 changes: 0 additions & 2 deletions summa-core/src/components/query_parser/morphology/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ use tantivy::query::{DisjunctionMaxQuery, Query, TermQuery};
use tantivy::schema::{Field, FieldType, IndexRecordOption};

mod english;
#[cfg(feature = "nn")]
mod english_nn;
mod manager;

pub use manager::MorphologyManager;
Expand Down
4 changes: 2 additions & 2 deletions summa-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ maintenance = { status = "actively-developed" }
tonic-build = { version = "0.9.1", default-features = false, features = ["prost", "transport"] }

[dev-dependencies]
summa-core = { version = "0.17.2", path = "../summa-core", features = ["fs", "hyper-external-request", "nn", "tokio-rt"] }
summa-core = { version = "0.17.2", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
tempdir = "0.3.7"

[dependencies]
Expand Down Expand Up @@ -59,7 +59,7 @@ serde = { workspace = true }
serde_derive = "1.0"
serde_json = { workspace = true }
serde_yaml = { workspace = true }
summa-core = { version = "0.17.2", path = "../summa-core", features = ["fs", "hyper-external-request", "nn", "tokio-rt"] }
summa-core = { version = "0.17.2", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-proto = { workspace = true, features = ["grpc"] }
take_mut = { workspace = true }
tantivy = { workspace = true }
Expand Down

0 comments on commit e740e50

Please sign in to comment.