Spaces:
Runtime error
Runtime error
File size: 714 Bytes
f6e3381 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | from fastapi import FastAPI
import os
app = FastAPI()
MODEL_PATH = "model.tflite"
# ===== تحويل من .h =====
def convert():
from mrk_model_data import mrk_model_data, mrk_model_data_len
with open(MODEL_PATH, "wb") as f:
f.write(bytes(mrk_model_data[:mrk_model_data_len]))
# ===== init =====
if not os.path.exists(MODEL_PATH):
convert()
@app.get("/")
def home():
return {"status": "ok", "model": os.path.exists(MODEL_PATH)}
# ===== AI RESPONSE (placeholder inference) =====
@app.post("/predict")
def predict(data: dict):
return {
"input": data,
"output": "MODEL_LOADED_SUCCESSFULLY",
"note": "No runtime engine yet (tflite-runtime missing)"
} |