Spaces:
Sleeping
Sleeping
cleaning, api desc added
Browse files7 unmodified lines8910111112131415161718192014151678 unmodified lines95969710510698991001011021031041051061071121081091101111121181131141151167 unmodified linesimport jsonimport logging
# logger = logging.getLogger(__name__)# loggerlogging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
# logging.debug('This is a debug message')# logging.info('This is an info message')# logging.warning('This is a warning message')# logging.error('This is an error message')# logging.critical('This is a critical message')
# Util Functions & Classesdef loading(fp): with open(fp, "rb") as f:78 unmodified lines return [i.dict() for i in cls.inputs]
# APIapp = FastAPI(title="API")# API Configapp = FastAPI(title="Agri-Tech API", description="This is a ML API for classification of crop to plant on a land regarding some features")
# ML Configml_objects = loading(fp=os.path.join("assets", "ml", "crop_recommandation2.pkl"))## Extract the ml componentsmodel = ml_objects["model"]scaler = ml_objects["scaler"].set_output(transform="pandas")labels = ml_objects["labels"]# = ml_objects[""]
# Endpoints@app.get("/")def root(): return {"API": " This is an API to ... ."} return {"Description": " This is a ML API for classification of crop to plant on a land regarding some features."}
@app.get("/checkup")main.py+7-12