Spaces:
Sleeping
Sleeping
Ikshitha Janarthanan commited on
Commit ·
1a4b93d
1
Parent(s): 445a7b6
fix:datasets revamp
Browse files- Dockerfile +9 -4
- requirements.txt +2 -1
- validate-submission.sh +1 -1
Dockerfile
CHANGED
|
@@ -40,9 +40,14 @@ RUN python -c 'from sentence_transformers import SentenceTransformer; SentenceTr
|
|
| 40 |
# Copy source files
|
| 41 |
COPY models.py environment.py inference.py app.py openenv.yaml ./
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
RUN apt-get update && apt-get install -y unzip &&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Environment variable defaults (DATA_DIR removed so it falls back to the local folder)
|
| 48 |
ENV TASK=all \
|
|
@@ -51,4 +56,4 @@ ENV TASK=all \
|
|
| 51 |
EXPOSE 7860
|
| 52 |
|
| 53 |
# Default: run the FastAPI server (used by inference.py and HF Space)
|
| 54 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 40 |
# Copy source files
|
| 41 |
COPY models.py environment.py inference.py app.py openenv.yaml ./
|
| 42 |
|
| 43 |
+
# Download the zip file directly (requires a direct download URL, not a folder sharing link)
|
| 44 |
+
# Download dataset using gdown (RELIABLE)
|
| 45 |
+
RUN apt-get update && apt-get install -y unzip && \
|
| 46 |
+
pip install --no-cache-dir gdown && \
|
| 47 |
+
gdown https://drive.google.com/uc?id=1-L8LCTSjjQs9qFdnIzFdnf0J37Yf6cxm -O Datasets.zip && \
|
| 48 |
+
unzip Datasets.zip -d ./ && \
|
| 49 |
+
rm Datasets.zip && \
|
| 50 |
+
rm -rf /var/lib/apt/lists/*
|
| 51 |
|
| 52 |
# Environment variable defaults (DATA_DIR removed so it falls back to the local folder)
|
| 53 |
ENV TASK=all \
|
|
|
|
| 56 |
EXPOSE 7860
|
| 57 |
|
| 58 |
# Default: run the FastAPI server (used by inference.py and HF Space)
|
| 59 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
CHANGED
|
@@ -36,4 +36,5 @@ datasets>=2.18.0
|
|
| 36 |
# Serving / inference client
|
| 37 |
httpx>=0.25.0
|
| 38 |
fastapi>=0.110.0
|
| 39 |
-
uvicorn>=0.29.0
|
|
|
|
|
|
| 36 |
# Serving / inference client
|
| 37 |
httpx>=0.25.0
|
| 38 |
fastapi>=0.110.0
|
| 39 |
+
uvicorn>=0.29.0
|
| 40 |
+
openenv-core
|
validate-submission.sh
CHANGED
|
@@ -109,7 +109,7 @@ CURL_OUTPUT=$(portable_mktemp "validate-curl")
|
|
| 109 |
CLEANUP_FILES+=("$CURL_OUTPUT")
|
| 110 |
HTTP_CODE=$(curl -s -o "$CURL_OUTPUT" -w "%{http_code}" -X POST \
|
| 111 |
-H "Content-Type: application/json" -d '{}' \
|
| 112 |
-
"$PING_URL/reset" --max-time
|
| 113 |
|
| 114 |
if [ "$HTTP_CODE" = "200" ]; then
|
| 115 |
pass "HF Space is live and responds to /reset"
|
|
|
|
| 109 |
CLEANUP_FILES+=("$CURL_OUTPUT")
|
| 110 |
HTTP_CODE=$(curl -s -o "$CURL_OUTPUT" -w "%{http_code}" -X POST \
|
| 111 |
-H "Content-Type: application/json" -d '{}' \
|
| 112 |
+
"$PING_URL/reset" --max-time 300 2>"$CURL_OUTPUT" || printf "000")
|
| 113 |
|
| 114 |
if [ "$HTTP_CODE" = "200" ]; then
|
| 115 |
pass "HF Space is live and responds to /reset"
|