Spaces:
Running
Running
Commit
·
4359925
1
Parent(s):
0b601a4
Huggingface configurations updated
Browse files- .env.example +0 -0
- Dockerfile +18 -0
- huggingface.yaml +6 -0
- logs/application/app_2025-10-31.log +3 -0
- logs/application/app_2025-11-03.log +0 -0
- requirements.txt +2 -49
- text_auth_app.py +0 -11
.env.example
DELETED
|
File without changes
|
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install git and dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y git
|
| 7 |
+
|
| 8 |
+
# Clone your GitHub repo
|
| 9 |
+
RUN git clone https://github.com/itobuztech/text_auth_ai.git .
|
| 10 |
+
|
| 11 |
+
# Install requirements
|
| 12 |
+
RUN pip install -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Create folders
|
| 15 |
+
RUN mkdir -p logs data/uploads data/reports models/cache
|
| 16 |
+
|
| 17 |
+
# Start app
|
| 18 |
+
CMD ["python", "text_auth_app.py"]
|
huggingface.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
title: "Text Auth AI"
|
| 2 |
+
emoji: "🔍"
|
| 3 |
+
colorFrom: "blue"
|
| 4 |
+
colorTo: "purple"
|
| 5 |
+
sdk: docker
|
| 6 |
+
app_port: 7860
|
logs/application/app_2025-10-31.log
CHANGED
|
@@ -762,3 +762,6 @@
|
|
| 762 |
{"text": "127.0.0.1:60014 - \"POST /api/analyze HTTP/1.1\" 200\n", "record": {"elapsed": {"repr": "0:05:50.806127", "seconds": 350.806127}, "exception": null, "extra": {}, "file": {"name": "h11_impl.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py"}, "function": "send", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 473, "message": "127.0.0.1:60014 - \"POST /api/analyze HTTP/1.1\" 200", "module": "h11_impl", "name": "uvicorn.protocols.http.h11_impl", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:53:27.248274+05:30", "timestamp": 1761909807.248274}}}
|
| 763 |
{"text": "API Request: GET / -> 200\n", "record": {"elapsed": {"repr": "0:06:42.563605", "seconds": 402.563605}, "exception": null, "extra": {"log_type": "application", "extra": {"http_method": "GET", "path": "/", "status_code": 200, "duration_seconds": 0.0023, "user": null, "ip_address": "127.0.0.1", "timestamp": "2025-10-31T16:54:19.005654"}}, "file": {"name": "logger.py", "path": "/Users/itobuz/projects/office/text_auth/utils/logger.py"}, "function": "log_api_request", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 374, "message": "API Request: GET / -> 200", "module": "logger", "name": "utils.logger", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:54:19.005752+05:30", "timestamp": 1761909859.005752}}}
|
| 764 |
{"text": "127.0.0.1:60018 - \"GET / HTTP/1.1\" 200\n", "record": {"elapsed": {"repr": "0:06:42.565133", "seconds": 402.565133}, "exception": null, "extra": {}, "file": {"name": "h11_impl.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py"}, "function": "send", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 473, "message": "127.0.0.1:60018 - \"GET / HTTP/1.1\" 200", "module": "h11_impl", "name": "uvicorn.protocols.http.h11_impl", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:54:19.007280+05:30", "timestamp": 1761909859.00728}}}
|
|
|
|
|
|
|
|
|
|
|
|
| 762 |
{"text": "127.0.0.1:60014 - \"POST /api/analyze HTTP/1.1\" 200\n", "record": {"elapsed": {"repr": "0:05:50.806127", "seconds": 350.806127}, "exception": null, "extra": {}, "file": {"name": "h11_impl.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py"}, "function": "send", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 473, "message": "127.0.0.1:60014 - \"POST /api/analyze HTTP/1.1\" 200", "module": "h11_impl", "name": "uvicorn.protocols.http.h11_impl", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:53:27.248274+05:30", "timestamp": 1761909807.248274}}}
|
| 763 |
{"text": "API Request: GET / -> 200\n", "record": {"elapsed": {"repr": "0:06:42.563605", "seconds": 402.563605}, "exception": null, "extra": {"log_type": "application", "extra": {"http_method": "GET", "path": "/", "status_code": 200, "duration_seconds": 0.0023, "user": null, "ip_address": "127.0.0.1", "timestamp": "2025-10-31T16:54:19.005654"}}, "file": {"name": "logger.py", "path": "/Users/itobuz/projects/office/text_auth/utils/logger.py"}, "function": "log_api_request", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 374, "message": "API Request: GET / -> 200", "module": "logger", "name": "utils.logger", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:54:19.005752+05:30", "timestamp": 1761909859.005752}}}
|
| 764 |
{"text": "127.0.0.1:60018 - \"GET / HTTP/1.1\" 200\n", "record": {"elapsed": {"repr": "0:06:42.565133", "seconds": 402.565133}, "exception": null, "extra": {}, "file": {"name": "h11_impl.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py"}, "function": "send", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 473, "message": "127.0.0.1:60018 - \"GET / HTTP/1.1\" 200", "module": "h11_impl", "name": "uvicorn.protocols.http.h11_impl", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-10-31 16:54:19.007280+05:30", "timestamp": 1761909859.00728}}}
|
| 765 |
+
{"text": "Shutting down\n", "record": {"elapsed": {"repr": "3 days, 1:49:04.570132", "seconds": 265744.570132}, "exception": null, "extra": {}, "file": {"name": "server.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/server.py"}, "function": "shutdown", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 263, "message": "Shutting down", "module": "server", "name": "uvicorn.server", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-11-03 18:36:41.012279+05:30", "timestamp": 1762175201.012279}}}
|
| 766 |
+
{"text": "Waiting for application shutdown.\n", "record": {"elapsed": {"repr": "3 days, 1:49:04.672115", "seconds": 265744.672115}, "exception": null, "extra": {}, "file": {"name": "on.py", "path": "/Users/itobuz/anaconda3/lib/python3.10/site-packages/uvicorn/lifespan/on.py"}, "function": "shutdown", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 67, "message": "Waiting for application shutdown.", "module": "on", "name": "uvicorn.lifespan.on", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-11-03 18:36:41.114262+05:30", "timestamp": 1762175201.114262}}}
|
| 767 |
+
{"text": "Logging system cleanup completed\n", "record": {"elapsed": {"repr": "3 days, 1:49:04.673039", "seconds": 265744.673039}, "exception": null, "extra": {}, "file": {"name": "logger.py", "path": "/Users/itobuz/projects/office/text_auth/utils/logger.py"}, "function": "cleanup", "level": {"icon": "ℹ️", "name": "INFO", "no": 20}, "line": 522, "message": "Logging system cleanup completed", "module": "logger", "name": "utils.logger", "process": {"id": 87463, "name": "SpawnProcess-4"}, "thread": {"id": 8707055360, "name": "MainThread"}, "time": {"repr": "2025-11-03 18:36:41.115186+05:30", "timestamp": 1762175201.115186}}}
|
logs/application/app_2025-11-03.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirements.txt
CHANGED
|
@@ -13,7 +13,6 @@ tokenizers==0.15.0
|
|
| 13 |
|
| 14 |
# NLP Libraries
|
| 15 |
spacy==3.7.2
|
| 16 |
-
#flair==0.13.1
|
| 17 |
nltk==3.8.1
|
| 18 |
textstat==0.7.3
|
| 19 |
|
|
@@ -32,17 +31,11 @@ python-magic==0.4.27
|
|
| 32 |
|
| 33 |
# Language Detection
|
| 34 |
langdetect==1.0.9
|
| 35 |
-
#fasttext==0.9.2
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
#textattack==0.3.8
|
| 39 |
-
|
| 40 |
-
# Visualization & Reporting
|
| 41 |
matplotlib==3.8.2
|
| 42 |
seaborn==0.13.0
|
| 43 |
-
plotly==5.18.0
|
| 44 |
reportlab==4.0.7
|
| 45 |
-
fpdf2==2.7.6
|
| 46 |
|
| 47 |
# Utilities
|
| 48 |
python-dotenv==1.0.0
|
|
@@ -55,44 +48,4 @@ loguru==0.7.2
|
|
| 55 |
python-json-logger==2.0.7
|
| 56 |
|
| 57 |
# Caching
|
| 58 |
-
|
| 59 |
-
diskcache==5.6.3
|
| 60 |
-
|
| 61 |
-
# Database (Optional)
|
| 62 |
-
sqlalchemy==2.0.23
|
| 63 |
-
alembic==1.13.0
|
| 64 |
-
|
| 65 |
-
# Testing
|
| 66 |
-
pytest==7.4.3
|
| 67 |
-
pytest-asyncio==0.21.1
|
| 68 |
-
pytest-cov==4.1.0
|
| 69 |
-
|
| 70 |
-
# Code Quality
|
| 71 |
-
black==23.12.0
|
| 72 |
-
flake8==6.1.0
|
| 73 |
-
mypy==1.7.1
|
| 74 |
-
|
| 75 |
-
# Security
|
| 76 |
-
cryptography==41.0.7
|
| 77 |
-
python-jose[cryptography]==3.3.0
|
| 78 |
-
|
| 79 |
-
# Performance
|
| 80 |
-
orjson==3.9.10
|
| 81 |
-
ujson==5.9.0
|
| 82 |
-
|
| 83 |
-
# Additional ML Tools
|
| 84 |
-
xgboost==2.0.2
|
| 85 |
-
lightgbm==4.1.0
|
| 86 |
-
|
| 87 |
-
# Dimensionality Analysis
|
| 88 |
-
#scikit-dimension==0.3.5
|
| 89 |
-
umap-learn==0.5.5
|
| 90 |
-
|
| 91 |
-
# Rate Limiting
|
| 92 |
-
slowapi==0.1.9
|
| 93 |
-
|
| 94 |
-
# CORS
|
| 95 |
-
fastapi-cors==0.0.6
|
| 96 |
-
|
| 97 |
-
# File type detection
|
| 98 |
-
python-magic-bin==0.4.14
|
|
|
|
| 13 |
|
| 14 |
# NLP Libraries
|
| 15 |
spacy==3.7.2
|
|
|
|
| 16 |
nltk==3.8.1
|
| 17 |
textstat==0.7.3
|
| 18 |
|
|
|
|
| 31 |
|
| 32 |
# Language Detection
|
| 33 |
langdetect==1.0.9
|
|
|
|
| 34 |
|
| 35 |
+
# Visualization & Reporting (Light versions)
|
|
|
|
|
|
|
|
|
|
| 36 |
matplotlib==3.8.2
|
| 37 |
seaborn==0.13.0
|
|
|
|
| 38 |
reportlab==4.0.7
|
|
|
|
| 39 |
|
| 40 |
# Utilities
|
| 41 |
python-dotenv==1.0.0
|
|
|
|
| 48 |
python-json-logger==2.0.7
|
| 49 |
|
| 50 |
# Caching
|
| 51 |
+
diskcache==5.6.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text_auth_app.py
CHANGED
|
@@ -1245,17 +1245,6 @@ async def log_requests(request: Request, call_next):
|
|
| 1245 |
return response
|
| 1246 |
|
| 1247 |
|
| 1248 |
-
|
| 1249 |
-
# ==================== RAILWAY DEPLOYMENT SUPPORT ====================
|
| 1250 |
-
import os
|
| 1251 |
-
# Override settings for Railway deployment
|
| 1252 |
-
if os.environ.get("RAILWAY_ENVIRONMENT"):
|
| 1253 |
-
settings.HOST = os.getenv("HOST", "0.0.0.0")
|
| 1254 |
-
settings.PORT = int(os.getenv("PORT", "8000"))
|
| 1255 |
-
settings.DEBUG = False
|
| 1256 |
-
logger.info(f"Railway deployment detected - Using host: {settings.HOST}, port: {settings.PORT}")
|
| 1257 |
-
|
| 1258 |
-
|
| 1259 |
# ==================== MAIN ====================
|
| 1260 |
if __name__ == "__main__":
|
| 1261 |
# Configure logging
|
|
|
|
| 1245 |
return response
|
| 1246 |
|
| 1247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1248 |
# ==================== MAIN ====================
|
| 1249 |
if __name__ == "__main__":
|
| 1250 |
# Configure logging
|