Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- app.py +8 -3
- dockerfile +2 -3
app.py
CHANGED
@@ -2,6 +2,11 @@ from fastapi import FastAPI
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
-
@app.
|
6 |
-
def
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
+
@app.post("/fine-tune")
|
6 |
+
def fine_tune_model():
|
7 |
+
import subprocess
|
8 |
+
result = subprocess.run(["python", "fine_tune.py"], capture_output=True, text=True)
|
9 |
+
if result.returncode == 0:
|
10 |
+
return {"status": "Fine-tuning completed successfully!", "logs": result.stdout}
|
11 |
+
else:
|
12 |
+
raise HTTPException(status_code=500, detail=f"Error during fine-tuning: {result.stderr}")
|
dockerfile
CHANGED
@@ -19,9 +19,8 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
19 |
# Copy the application files
|
20 |
COPY . .
|
21 |
|
22 |
-
# Expose the port your app runs on
|
23 |
EXPOSE 7860
|
24 |
|
25 |
-
# Command to start the
|
26 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
27 |
-
|
|
|
19 |
# Copy the application files
|
20 |
COPY . .
|
21 |
|
22 |
+
# Expose the port your app runs on
|
23 |
EXPOSE 7860
|
24 |
|
25 |
+
# Command to start the Python fine-tuning script
|
26 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|