Spaces:
Running
Running
Commit
Β·
7596c77
1
Parent(s):
64baedd
Dockerfile updated
Browse files- Dockerfile +36 -10
- README.md +12 -0
- huggingface.yaml +0 -6
- logs/application/app_2025-11-03.log +0 -0
- setup.sh +22 -0
Dockerfile
CHANGED
|
@@ -1,18 +1,44 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
# Clone your GitHub repo
|
| 9 |
-
RUN git clone https://github.com/itobuztech/text_auth_ai.git .
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
# Create folders
|
| 15 |
-
RUN mkdir -p logs data/uploads data/reports models/cache
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# install system dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
+
build-essential \
|
| 9 |
+
curl \
|
| 10 |
+
git \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
# Set environment variables
|
| 15 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 16 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 17 |
+
HF_HOME=/tmp/huggingface \
|
| 18 |
+
TRANSFORMERS_CACHE=/tmp/transformers \
|
| 19 |
+
HF_DATASETS_CACHE=/tmp/datasets \
|
| 20 |
+
TOKENIZERS_PARALLELISM=false
|
| 21 |
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
# Create necessary directories
|
| 24 |
+
RUN mkdir -p /tmp/huggingface /tmp/transformers /tmp/datasets /app/data/reports /app/data/uploads
|
| 25 |
+
|
| 26 |
+
# Copy requirements first for better caching
|
| 27 |
+
COPY requirements.txt .
|
| 28 |
+
|
| 29 |
+
# Install python dependencies
|
| 30 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 31 |
+
|
| 32 |
+
# Copy application code
|
| 33 |
+
COPY . .
|
| 34 |
+
|
| 35 |
+
# Expose port 7860 (hugging Face Spaces Standard)
|
| 36 |
+
EXPOSE 7860
|
| 37 |
+
|
| 38 |
+
# Health check
|
| 39 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=5 \
|
| 40 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
# Run the application
|
| 44 |
+
CMD ["uvicorn", "text_auth_app:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<div align="center">
|
| 2 |
|
| 3 |
# π AI Text Authentication Platform
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Text Authentication Platform
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "4.36.0"
|
| 8 |
+
app_file: text_auth_app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
<div align="center">
|
| 14 |
|
| 15 |
# π AI Text Authentication Platform
|
huggingface.yaml
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
title: "Text Auth AI"
|
| 2 |
-
emoji: "π"
|
| 3 |
-
colorFrom: "blue"
|
| 4 |
-
colorTo: "purple"
|
| 5 |
-
sdk: docker
|
| 6 |
-
app_port: 7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logs/application/app_2025-11-03.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
setup.sh
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Post-installation setup script for Hugging Face Spaces
|
| 4 |
+
echo "Starting setup for Text-Authentication Platform ..."
|
| 5 |
+
|
| 6 |
+
# Download Spacy Model
|
| 7 |
+
echo "Downloading SpaCy English model ..."
|
| 8 |
+
python -n spacy download en_core_web_sm
|
| 9 |
+
|
| 10 |
+
# Download NLTK data
|
| 11 |
+
echo "Downloading NLTK data ..."
|
| 12 |
+
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('averaged_perceptron_tagger')"
|
| 13 |
+
|
| 14 |
+
# Create necessary directories
|
| 15 |
+
echo "Creating directories ..."
|
| 16 |
+
mkdir -p data/reports data/uploads
|
| 17 |
+
|
| 18 |
+
# Verify installation
|
| 19 |
+
echo "Verifying installations ..."
|
| 20 |
+
python -c "import transformers; import torch; import spacy; print('All core libraries imported successfully.')"
|
| 21 |
+
|
| 22 |
+
echo "Setup complete !"
|