Spaces:
Runtime error
Runtime error
Christian Rene Thelen
commited on
Commit
·
125060a
1
Parent(s):
72096f6
Model moved
Browse files- Dockerfile +3 -3
- subtask2_final_gradio.py → app.py +2 -2
Dockerfile
CHANGED
|
@@ -59,10 +59,10 @@ COPY requirements.txt .
|
|
| 59 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 60 |
|
| 61 |
# Copy application code
|
| 62 |
-
COPY
|
| 63 |
|
| 64 |
# Create directory for model weights
|
| 65 |
-
RUN mkdir -p
|
| 66 |
|
| 67 |
# Set CUDA environment variables
|
| 68 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
|
@@ -76,4 +76,4 @@ RUN useradd -m -u 1002 appuser && chown -R appuser:appuser /app
|
|
| 76 |
USER appuser
|
| 77 |
|
| 78 |
# Command to run the application
|
| 79 |
-
CMD ["python", "
|
|
|
|
| 59 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 60 |
|
| 61 |
# Copy application code
|
| 62 |
+
COPY app.py .
|
| 63 |
|
| 64 |
# Create directory for model weights
|
| 65 |
+
RUN mkdir -p model
|
| 66 |
|
| 67 |
# Set CUDA environment variables
|
| 68 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
|
|
|
| 76 |
USER appuser
|
| 77 |
|
| 78 |
# Command to run the application
|
| 79 |
+
CMD ["python", "app.py"]
|
subtask2_final_gradio.py → app.py
RENAMED
|
@@ -601,7 +601,7 @@ if __name__ == "__main__":
|
|
| 601 |
id2label=classifier.id2label,
|
| 602 |
label2id=classifier.label2id
|
| 603 |
)
|
| 604 |
-
classifier.model.load_state_dict(torch.load('./
|
| 605 |
classifier.model.eval()
|
| 606 |
|
| 607 |
print("Modell geladen! Starte Gradio-Interface...")
|
|
@@ -615,4 +615,4 @@ if __name__ == "__main__":
|
|
| 615 |
server_port=7860,
|
| 616 |
debug=True,
|
| 617 |
show_error=True
|
| 618 |
-
)
|
|
|
|
| 601 |
id2label=classifier.id2label,
|
| 602 |
label2id=classifier.label2id
|
| 603 |
)
|
| 604 |
+
classifier.model.load_state_dict(torch.load('./model/subtask2_final_model.pth'))
|
| 605 |
classifier.model.eval()
|
| 606 |
|
| 607 |
print("Modell geladen! Starte Gradio-Interface...")
|
|
|
|
| 615 |
server_port=7860,
|
| 616 |
debug=True,
|
| 617 |
show_error=True
|
| 618 |
+
)
|