Refactor Dockerfile and add fit_model functionality

- Updated the Dockerfile to rename the built binary from `mf-fitter` to `fit_model` for clarity.
- Introduced a new `fit_model_args.rs` file to define command-line arguments for the fit model process, including parameters for matrix factorization.
- Added `pg_types.rs` and `pgvector.rs` files to handle PostgreSQL type interactions and vector serialization/deserialization.
- Implemented the main logic for the fit model in `fit_model.rs`, including data loading, model training, and embedding saving.
- Enhanced `visualize_embeddings.rs` to load embeddings and clusters more efficiently.

These changes improve the organization and functionality of the model fitting process, making it more intuitive and maintainable.
This commit is contained in:
Dylan Knutson
2024-12-28 19:50:24 +00:00
parent bc88c54cb0
commit 75e7a4538d
7 changed files with 351 additions and 109 deletions

View File

@@ -32,7 +32,7 @@ COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release && \
cp target/release/mf-fitter /app/mf-fitter
cp target/release/fit_model /app/fit_model
# Create the runtime image
FROM debian:bullseye-slim
@@ -48,7 +48,7 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/*
# Copy the binary from builder
COPY --from=builder /app/mf-fitter /usr/local/bin/
COPY --from=builder /app/fit_model /usr/local/bin/
COPY --from=builder /app/.env.example /app/.env
WORKDIR /app
@@ -56,4 +56,4 @@ WORKDIR /app
# Set environment variables
ENV RUST_LOG=info
ENTRYPOINT ["/usr/local/bin/mf-fitter"]
ENTRYPOINT ["/usr/local/bin/fit_model"]