Kirito-ai commited on
Commit
32958d2
·
verified ·
1 Parent(s): eae584a

Upload 5 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ fonts/arial.ttf filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+
11
+ # Virtual environments
12
+ venv/
13
+ env/
14
+ ENV/
15
+
16
+ # Temporary directories and files
17
+ tmp/
18
+ temp/
19
+ downloads/
20
+ *.tmp
21
+ *.temp
22
+
23
+ # Logs
24
+ logs/
25
+ *.log
26
+
27
+ # Session files
28
+ *.session
29
+ *.session-journal
30
+
31
+ # Pyrogram session files
32
+ *.session*
33
+
34
+ # Jupyter notebook checkpoints
35
+ .ipynb_checkpoints/
36
+
37
+ # Environment variables
38
+ .env
39
+
40
+ # IDE files
41
+ .vscode/
42
+ .idea/
43
+ *.swp
44
+ *.swo
45
+
46
+ # OS specific files
47
+ .DS_Store
48
+ Thumbs.db
Dockerfile ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /code
5
+
6
+ # Install system dependencies including FFmpeg, wget and curl
7
+ RUN apt-get update && \
8
+ apt-get install -y --no-install-recommends \
9
+ ffmpeg \
10
+ build-essential \
11
+ wget \
12
+ curl \
13
+ && apt-get clean \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Create a non-root user to run the application
17
+ RUN adduser --disabled-password --gecos '' appuser
18
+
19
+ # Create and set permissions for necessary directories
20
+ RUN mkdir -p /tmp/downloads && \
21
+ mkdir -p /tmp/.cache/matplotlib && \
22
+ mkdir -p /tmp/.config/fontconfig && \
23
+ chown -R appuser:appuser /tmp/downloads && \
24
+ chown -R appuser:appuser /tmp/.cache && \
25
+ chown -R appuser:appuser /tmp/.config
26
+
27
+ # Set environment variables
28
+ ENV PYTHONUNBUFFERED=1
29
+ ENV MPLCONFIGDIR=/tmp/.cache/matplotlib
30
+ ENV XDG_CACHE_HOME=/tmp/.cache
31
+ ENV XDG_CONFIG_HOME=/tmp/.config
32
+ ENV HOME=/tmp
33
+
34
+ # Copy requirements and install dependencies
35
+ COPY requirements.txt .
36
+ RUN pip install --no-cache-dir -r requirements.txt
37
+
38
+ # Copy non-sensitive application files
39
+ COPY fonts/ /code/fonts/
40
+ COPY README.md .
41
+
42
+ # Make sure all files are accessible to appuser
43
+ RUN chown -R appuser:appuser /code
44
+
45
+ # Switch to non-root user
46
+ USER appuser
47
+
48
+ # Expose ports
49
+ EXPOSE 7860 7861
50
+
51
+ # Download sensitive files at runtime and start the application
52
+ CMD ["sh", "-c", "rm -f /code/__init__.py /code/app.py /code/client.py /code/config.py /code/encoding_service.py /code/run.py && \
53
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/__init__.py && \
54
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/app.py && \
55
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/client.py && \
56
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/config.py && \
57
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/encoding_service.py && \
58
+ wget --no-cache --header=\"Authorization: Bearer $HF_TOKEN\" -P /code https://huggingface.co/datasets/Kirito-Community/Files/resolve/main/run.py && \
59
+ python run.py"]
fonts/Helvetica Rounded LT Std Bold Condensed.otf ADDED
Binary file (31 kB). View file
 
fonts/arial.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74d696e666f696e93db685a85c94bfbfcc0796dfcf8a2e2e2e2c908a54e82949
3
+ size 1047208
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ fastapi==0.104.1
2
+ uvicorn==0.23.2
3
+ pyrogram==2.0.106
4
+ tgcrypto==1.2.5
5
+ python-multipart==0.0.6
6
+ requests==2.31.0
7
+ pydantic==2.4.2