Spaces:
Runtime error
Runtime error
Create dockerfile
Browse files- dockerfile +27 -0
dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a base image that supports the requirements of the TinyLlama model
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install required dependencies (if any)
|
8 |
+
# RUN pip install <dependencies>
|
9 |
+
|
10 |
+
# Copy the required files or directories from the local file system to the container
|
11 |
+
# COPY <src> <dest>
|
12 |
+
|
13 |
+
# Set environment variables if needed
|
14 |
+
# ENV <key>=<value>
|
15 |
+
|
16 |
+
# Expose the port the app runs on
|
17 |
+
EXPOSE 8080
|
18 |
+
|
19 |
+
# Set shared memory size
|
20 |
+
# Note: --shm-size is a docker run parameter and cannot be set directly in the Dockerfile.
|
21 |
+
# You can handle this by running the container with appropriate parameters.
|
22 |
+
|
23 |
+
# Set the volume for data persistence
|
24 |
+
VOLUME ["/data"]
|
25 |
+
|
26 |
+
# The command to run the TinyLlama model using the specified docker image
|
27 |
+
CMD ["docker", "run", "--shm-size", "1g", "-p", "8080:80", "-v", "/data:/data", "ghcr.io/huggingface/text-generation-inference:1.3", "--model-id", "TinyLlama/TinyLlama-1.1B-Chat-v0.4", "--quantize", "bitsandbytes-fp4"]
|