uzzam2121 commited on
Commit
5353eed
ยท
1 Parent(s): 8365766

Deploy word complexity API

Browse files
Files changed (2) hide show
  1. Dockerfile +33 -0
  2. README.md +22 -5
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Space โ€” clones GitHub repo at build time.
2
+ # Push this file + README.md to: uzzam24/complexity-levels-api
3
+ FROM python:3.11-slim
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ build-essential git \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ RUN useradd -m -u 1000 user
10
+
11
+ WORKDIR /app
12
+
13
+ RUN git clone --depth 1 https://github.com/muhammad245/complexityLevels.git /app/repo
14
+
15
+ RUN pip install --no-cache-dir -r /app/repo/deploy/backend/requirements.txt huggingface_hub \
16
+ && python -m spacy download en_core_web_sm
17
+
18
+ RUN chmod +x /app/repo/deploy/huggingface/entrypoint.sh \
19
+ && chown -R user:user /app
20
+
21
+ ENV MODEL_PATH=/app/model
22
+ ENV HF_MODEL_REPO=uzzam24/deberta-complexity-lcp
23
+ ENV APP_ROOT=/app/repo
24
+ ENV PYTHONPATH=/app/repo:/app/repo/deploy/backend
25
+ ENV PORT=7860
26
+ ENV CORS_ALLOW_ALL=1
27
+ ENV EAGER_LOAD_MODEL=1
28
+ ENV HF_HOME=/home/user/.cache/huggingface
29
+
30
+ USER user
31
+ EXPOSE 7860
32
+
33
+ CMD ["/app/repo/deploy/huggingface/entrypoint.sh"]
README.md CHANGED
@@ -1,10 +1,27 @@
1
  ---
2
- title: Complexity Levels Api
3
- emoji: ๐ŸŒ–
4
- colorFrom: yellow
5
- colorTo: blue
6
  sdk: docker
 
7
  pinned: false
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Word Complexity API
3
+ emoji: ๐Ÿ“–
4
+ colorFrom: blue
5
+ colorTo: green
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: false
9
+ license: mit
10
  ---
11
 
12
+ # Word Complexity API
13
+
14
+ FastAPI backend for word complexity prediction (DeBERTa).
15
+
16
+ - Model: `uzzam24/deberta-complexity-lcp`
17
+ - GitHub: [muhammad245/complexityLevels](https://github.com/muhammad245/complexityLevels)
18
+
19
+ ## Endpoints
20
+
21
+ - `GET /health`
22
+ - `POST /api/predict`
23
+ - `POST /api/intervene`
24
+ - `POST /api/intervene/all`
25
+ - `POST /api/efficiency`
26
+
27
+ Docs: `/docs`