Spaces:
Paused
Paused
Rename config.py to dockerfile
Browse files- config.py +0 -11
- dockerfile +23 -0
config.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
# config.py
|
| 2 |
-
class Config:
|
| 3 |
-
API_KEY = "api_key" # Placeholder for the API key, initially set to None
|
| 4 |
-
|
| 5 |
-
@classmethod
|
| 6 |
-
def set_api_key(cls, api_key):
|
| 7 |
-
cls.API_KEY = api_key
|
| 8 |
-
|
| 9 |
-
@classmethod
|
| 10 |
-
def get_api_key(cls):
|
| 11 |
-
return cls.API_KEY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.8
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install dependencies
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
+
RUN pip install -r requirements.txt
|
| 8 |
+
|
| 9 |
+
# Copy application code
|
| 10 |
+
COPY . .
|
| 11 |
+
|
| 12 |
+
# Set environment variables (optional)
|
| 13 |
+
# ENV HF_TOKEN="write_token"
|
| 14 |
+
|
| 15 |
+
# Download and cache the code generation model
|
| 16 |
+
RUN transformers-cli login
|
| 17 |
+
RUN transformers-cli download Salesforce/codegen-350M-mono --cache_dir /app/.cache
|
| 18 |
+
|
| 19 |
+
# Expose port for Gradio interface (optional)
|
| 20 |
+
EXPOSE 7860
|
| 21 |
+
|
| 22 |
+
# Run the application
|
| 23 |
+
CMD ["python", "app.py"]
|