Sean MacAvaney commited on
Commit
402a355
·
2 Parent(s): e17c347ef7677f

Merge remote-tracking branch 'origin/main'

Browse files
Files changed (3) hide show
  1. Dockerfile +45 -0
  2. README.md +1 -1
  3. app.py +1 -1
Dockerfile ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image
2
+ FROM python:3.10-slim
3
+
4
+ # Avoid interactive prompts
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # System deps (for building Python + Rust crates)
8
+ RUN apt-get update && apt-get install -y \
9
+ curl \
10
+ build-essential \
11
+ default-jre \
12
+ default-jre-headless \
13
+ default-jdk \
14
+ default-jdk-headless \
15
+ debianutils \
16
+ git \
17
+ openssl \
18
+ libssl-dev \
19
+ pkg-config \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ # Install Rust (latest stable via rustup)
23
+ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
24
+ ENV PATH="/root/.cargo/bin:${PATH}"
25
+
26
+ # Verify versions (optional but useful for logs)
27
+ RUN rustc --version && cargo --version
28
+
29
+ # Set workdir
30
+ WORKDIR /app
31
+
32
+ # Copy dependency files first (for caching)
33
+ COPY requirements.txt .
34
+
35
+ # Install Python deps
36
+ RUN pip install --no-cache-dir -r requirements.txt
37
+
38
+ # Copy the rest of the app
39
+ COPY . .
40
+
41
+ # Expose port (HF expects 7860)
42
+ EXPOSE 7860
43
+
44
+ # Run the app
45
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -13,4 +13,4 @@ pinned: false
13
  # 🐕 PyTerrier: SPLADE
14
 
15
  This is a demonstration of [PyTerrier's SPLADE package](https://github.com/cmacdonald/pyt_splade). The SPLADE model encodes queries and documents
16
- into sparse representations, which can then be used for indexing and retrieval.
 
13
  # 🐕 PyTerrier: SPLADE
14
 
15
  This is a demonstration of [PyTerrier's SPLADE package](https://github.com/cmacdonald/pyt_splade). The SPLADE model encodes queries and documents
16
+ into sparse representations, which can then be used for indexing and retrieval.
app.py CHANGED
@@ -104,4 +104,4 @@ interface(
104
  scale=2/3
105
  ),
106
  MarkdownFile('wrapup.md'),
107
- ).launch(share=False)
 
104
  scale=2/3
105
  ),
106
  MarkdownFile('wrapup.md'),
107
+ ).launch(share=False, server_name="0.0.0.0", server_port=7860)