Runa_max_train / app.py
gokstad's picture
Upload 2 files
82f1c9d verified
raw
history blame contribute delete
430 Bytes
from fastapi import FastAPI
app = FastAPI()
@app.post("/fine-tune")
def fine_tune_model():
import subprocess
result = subprocess.run(["python", "fine_tune.py"], capture_output=True, text=True)
if result.returncode == 0:
return {"status": "Fine-tuning completed successfully!", "logs": result.stdout}
else:
raise HTTPException(status_code=500, detail=f"Error during fine-tuning: {result.stderr}")