diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..a6344aac8c09253b3b630fb776ae94478aa0275b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000000000000000000000000000000000..da0d6bca92a39a7c2383f86fd9f3b866d68b3ba0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: MLaaS CI/CD Pipeline + +on: + push: + branches: + - main # Runs this workflow when changes are pushed to the main branch + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set Up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Install Dependencies + run: pip install -r api/requirement.txt + + - name: Run Tests + run: pytest tests/ || echo "No tests found, skipping..." + + deploy: + needs: build-and-test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Configure Git for Hugging Face + run: | + git config --global user.email "annishjk01@gmail.com" + git config --global user.name "annishjk01" + + - name: Deploy to Hugging Face Spaces + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} # Use secure Hugging Face token + run: | + git remote add huggingface https://user:$HF_TOKEN@huggingface.co/spaces/annishjk01/firstSpace || true + git fetch huggingface main || true # Fetch latest changes from HF (ignore errors) + git push --force huggingface main diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8146d862890e625b7e7ae30fa30e75063aa52a96 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +--- +title: TestModel +emoji: 🏃 +colorFrom: blue +colorTo: blue +sdk: docker +pinned: false +--- + +Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference diff --git a/api/__pycache__/app.cpython-310.pyc b/api/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b0c5cc704d3165554a087ab9db78eada97d31a8 Binary files /dev/null and b/api/__pycache__/app.cpython-310.pyc differ diff --git a/api/app.py b/api/app.py new file mode 100644 index 0000000000000000000000000000000000000000..e633f06417b740dada365bca22a9b525b1627195 --- /dev/null +++ b/api/app.py @@ -0,0 +1,29 @@ +# from fastapi import FastAPI +# import joblib +# import numpy as np + +# app = FastAPI() +# model = joblib.load("model/model.pkl") + +# @app.post("/predict/") +# def predict(features: list): +# prediction = model.predict([np.array(features)]) +# return {"prediction": prediction.tolist()} + +from fastapi import FastAPI +from pydantic import BaseModel +import joblib +import numpy as np + +app = FastAPI() +model = joblib.load("model/model.pkl") +print("Classes:", model.classes_) + +# ✅ Define Request Body Schema using Pydantic +class InputData(BaseModel): + features: list[float] # Ensures 'features' is a required list of floats + +@app.post("/predict/") +def predict(data: InputData): + prediction = model.predict([np.array(data.features)]) + return {"prediction": prediction.tolist()} diff --git a/api/requirement.txt b/api/requirement.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2dd74031a8e836d003269ffa93c974a5d09d3de --- /dev/null +++ b/api/requirement.txt @@ -0,0 +1,3 @@ +fastapi +uvicorn[standard] +pytest \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/MLmodel b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/MLmodel new file mode 100644 index 0000000000000000000000000000000000000000..443f4d3abc3da48efd60d3177170d043a49ef451 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/MLmodel @@ -0,0 +1,30 @@ +artifact_path: model +flavors: + python_function: + env: + conda: conda.yaml + virtualenv: python_env.yaml + loader_module: mlflow.sklearn + model_path: model.pkl + predict_fn: predict + python_version: 3.10.9 + sklearn: + code: null + pickled_model: model.pkl + serialization_format: cloudpickle + sklearn_version: 1.5.2 +is_signature_from_type_hint: false +mlflow_version: 2.20.3 +model_size_bytes: 172210 +model_uuid: 07c9da0b09de466fbf54ca9753f0b8d7 +run_id: 149d830f04264620bf6f2616798037ed +saved_input_example_info: + artifact_path: input_example.json + serving_input_path: serving_input_example.json + type: ndarray +signature: + inputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float64", "shape": [-1, 4]}}]' + outputs: '[{"type": "tensor", "tensor-spec": {"dtype": "int32", "shape": [-1]}}]' + params: null +type_hint_from_example: false +utc_time_created: '2025-03-07 17:45:36.126489' diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/conda.yaml b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/conda.yaml new file mode 100644 index 0000000000000000000000000000000000000000..254c1d2843d3abe428458c3de3c8625b27eefd76 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/conda.yaml @@ -0,0 +1,16 @@ +channels: +- conda-forge +dependencies: +- python=3.10.9 +- pip<=22.3.1 +- pip: + - mlflow==2.20.3 + - cloudpickle==2.0.0 + - lz4==3.1.3 + - numpy==1.26.4 + - pandas==1.5.3 + - pathlib==1.0.1 + - psutil==5.9.0 + - scikit-learn==1.5.2 + - scipy==1.14.1 +name: mlflow-env diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/input_example.json b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/input_example.json new file mode 100644 index 0000000000000000000000000000000000000000..8316ef40bd92f5323ec380548118cdfd0590e2e4 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/input_example.json @@ -0,0 +1 @@ +[[6.1, 2.8, 4.7, 1.2]] \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/model.pkl b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a74cb3b5b51d685e4f33efda8982cf61ddde2d39 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c08b235d633c20ba78ea08c14fe1d94bc5f0b01cfd4233dcf8eb4caecbd80be +size 172103 diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/python_env.yaml b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/python_env.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f91cc7d7f6722f52aafd49e8570a9faed7e0ab0 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/python_env.yaml @@ -0,0 +1,7 @@ +python: 3.10.9 +build_dependencies: +- pip==22.3.1 +- setuptools==65.6.3 +- wheel==0.38.4 +dependencies: +- -r requirements.txt diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/requirements.txt b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f5344cff29058ecc126ad937030aebd3e30a89e --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/requirements.txt @@ -0,0 +1,9 @@ +mlflow==2.20.3 +cloudpickle==2.0.0 +lz4==3.1.3 +numpy==1.26.4 +pandas==1.5.3 +pathlib==1.0.1 +psutil==5.9.0 +scikit-learn==1.5.2 +scipy==1.14.1 \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/serving_input_example.json b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/serving_input_example.json new file mode 100644 index 0000000000000000000000000000000000000000..6e279f36c1ef33bd6f64905e610eb0e4ac25ae28 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts/model/serving_input_example.json @@ -0,0 +1,10 @@ +{ + "inputs": [ + [ + 6.1, + 2.8, + 4.7, + 1.2 + ] + ] +} \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/meta.yaml b/mlruns/0/149d830f04264620bf6f2616798037ed/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99825de3170e993038d61d61786ad3f469df13a6 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/meta.yaml @@ -0,0 +1,15 @@ +artifact_uri: file:///C:/Users/Annish/Documents/Mlaas/mlruns/0/149d830f04264620bf6f2616798037ed/artifacts +end_time: 1741369540135 +entry_point_name: '' +experiment_id: '0' +lifecycle_stage: active +run_id: 149d830f04264620bf6f2616798037ed +run_name: mercurial-jay-523 +run_uuid: 149d830f04264620bf6f2616798037ed +source_name: '' +source_type: 4 +source_version: '' +start_time: 1741369536110 +status: 3 +tags: [] +user_id: Annish diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/metrics/accuracy b/mlruns/0/149d830f04264620bf6f2616798037ed/metrics/accuracy new file mode 100644 index 0000000000000000000000000000000000000000..c5431422fd4477a4ffcf7a12dab15c0331011e5f --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/metrics/accuracy @@ -0,0 +1 @@ +1741369536126 1.0 0 diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.log-model.history b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.log-model.history new file mode 100644 index 0000000000000000000000000000000000000000..e394ca5c2473f0d8904d9c8554deb684b1a2cb06 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.log-model.history @@ -0,0 +1 @@ +[{"run_id": "149d830f04264620bf6f2616798037ed", "artifact_path": "model", "utc_time_created": "2025-03-07 17:45:36.126489", "model_uuid": "07c9da0b09de466fbf54ca9753f0b8d7", "flavors": {"python_function": {"model_path": "model.pkl", "predict_fn": "predict", "loader_module": "mlflow.sklearn", "python_version": "3.10.9", "env": {"conda": "conda.yaml", "virtualenv": "python_env.yaml"}}, "sklearn": {"pickled_model": "model.pkl", "sklearn_version": "1.5.2", "serialization_format": "cloudpickle", "code": null}}}] \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.runName b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.runName new file mode 100644 index 0000000000000000000000000000000000000000..bae48d628efa8fb5ab9ea2e8c268a8c558800e5f --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.runName @@ -0,0 +1 @@ +mercurial-jay-523 \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.git.commit b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.git.commit new file mode 100644 index 0000000000000000000000000000000000000000..8655f40d42f042ff72b2951145eb40bfd75519e9 --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.git.commit @@ -0,0 +1 @@ +f3cc11642dba9f5288b3fd0c447a031a5e80d786 \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.name b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.name new file mode 100644 index 0000000000000000000000000000000000000000..b063a5c979c1b14802ac9d3b5a8d736c70d02d6c --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.name @@ -0,0 +1 @@ +model/train.py \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.type b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.type new file mode 100644 index 0000000000000000000000000000000000000000..0c2c1fe9dc63b7040bb81006635e50fd528f056f --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.source.type @@ -0,0 +1 @@ +LOCAL \ No newline at end of file diff --git a/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.user b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.user new file mode 100644 index 0000000000000000000000000000000000000000..064b49c9481e2ce4508c64ae068c02be8a068bbb --- /dev/null +++ b/mlruns/0/149d830f04264620bf6f2616798037ed/tags/mlflow.user @@ -0,0 +1 @@ +Annish \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/MLmodel b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/MLmodel new file mode 100644 index 0000000000000000000000000000000000000000..7cd1a3874a7c75719e7358ba44962c1d2722e1f2 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/MLmodel @@ -0,0 +1,20 @@ +artifact_path: model +flavors: + python_function: + env: + conda: conda.yaml + virtualenv: python_env.yaml + loader_module: mlflow.sklearn + model_path: model.pkl + predict_fn: predict + python_version: 3.10.9 + sklearn: + code: null + pickled_model: model.pkl + serialization_format: cloudpickle + sklearn_version: 1.5.2 +mlflow_version: 2.20.3 +model_size_bytes: 175629 +model_uuid: 6577a639374b4bae8dbc2d985c3154aa +run_id: 24c681814a5546c9889f73990b06eea6 +utc_time_created: '2025-03-07 17:43:50.283416' diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/conda.yaml b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/conda.yaml new file mode 100644 index 0000000000000000000000000000000000000000..254c1d2843d3abe428458c3de3c8625b27eefd76 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/conda.yaml @@ -0,0 +1,16 @@ +channels: +- conda-forge +dependencies: +- python=3.10.9 +- pip<=22.3.1 +- pip: + - mlflow==2.20.3 + - cloudpickle==2.0.0 + - lz4==3.1.3 + - numpy==1.26.4 + - pandas==1.5.3 + - pathlib==1.0.1 + - psutil==5.9.0 + - scikit-learn==1.5.2 + - scipy==1.14.1 +name: mlflow-env diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/model.pkl b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7dce66f656dfa25d4f819adbd2ae66a5c5b438d3 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:691bb44de4051daad447f180baa6e6e85b6db45c251c4139ccf6a641f56ac6d0 +size 175629 diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/python_env.yaml b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/python_env.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f91cc7d7f6722f52aafd49e8570a9faed7e0ab0 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/python_env.yaml @@ -0,0 +1,7 @@ +python: 3.10.9 +build_dependencies: +- pip==22.3.1 +- setuptools==65.6.3 +- wheel==0.38.4 +dependencies: +- -r requirements.txt diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/requirements.txt b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f5344cff29058ecc126ad937030aebd3e30a89e --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts/model/requirements.txt @@ -0,0 +1,9 @@ +mlflow==2.20.3 +cloudpickle==2.0.0 +lz4==3.1.3 +numpy==1.26.4 +pandas==1.5.3 +pathlib==1.0.1 +psutil==5.9.0 +scikit-learn==1.5.2 +scipy==1.14.1 \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/meta.yaml b/mlruns/0/24c681814a5546c9889f73990b06eea6/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e893b1c05e083f91616684a12ab2066b922e727 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/meta.yaml @@ -0,0 +1,15 @@ +artifact_uri: file:///C:/Users/Annish/Documents/Mlaas/mlruns/0/24c681814a5546c9889f73990b06eea6/artifacts +end_time: 1741369434436 +entry_point_name: '' +experiment_id: '0' +lifecycle_stage: active +run_id: 24c681814a5546c9889f73990b06eea6 +run_name: agreeable-wolf-200 +run_uuid: 24c681814a5546c9889f73990b06eea6 +source_name: '' +source_type: 4 +source_version: '' +start_time: 1741369430251 +status: 3 +tags: [] +user_id: Annish diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/metrics/accuracy b/mlruns/0/24c681814a5546c9889f73990b06eea6/metrics/accuracy new file mode 100644 index 0000000000000000000000000000000000000000..b5770936448b2b4c9e7a4f532f908fd45334122a --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/metrics/accuracy @@ -0,0 +1 @@ +1741369430277 1.0 0 diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.log-model.history b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.log-model.history new file mode 100644 index 0000000000000000000000000000000000000000..e358a9ce34afda48b6cbce2adde16d7649c9b52d --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.log-model.history @@ -0,0 +1 @@ +[{"run_id": "24c681814a5546c9889f73990b06eea6", "artifact_path": "model", "utc_time_created": "2025-03-07 17:43:50.283416", "model_uuid": "6577a639374b4bae8dbc2d985c3154aa", "flavors": {"python_function": {"model_path": "model.pkl", "predict_fn": "predict", "loader_module": "mlflow.sklearn", "python_version": "3.10.9", "env": {"conda": "conda.yaml", "virtualenv": "python_env.yaml"}}, "sklearn": {"pickled_model": "model.pkl", "sklearn_version": "1.5.2", "serialization_format": "cloudpickle", "code": null}}}] \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.runName b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.runName new file mode 100644 index 0000000000000000000000000000000000000000..68e8b9331758fa62e6f827f7f977493a15da10b6 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.runName @@ -0,0 +1 @@ +agreeable-wolf-200 \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.git.commit b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.git.commit new file mode 100644 index 0000000000000000000000000000000000000000..8655f40d42f042ff72b2951145eb40bfd75519e9 --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.git.commit @@ -0,0 +1 @@ +f3cc11642dba9f5288b3fd0c447a031a5e80d786 \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.name b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.name new file mode 100644 index 0000000000000000000000000000000000000000..b063a5c979c1b14802ac9d3b5a8d736c70d02d6c --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.name @@ -0,0 +1 @@ +model/train.py \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.type b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.type new file mode 100644 index 0000000000000000000000000000000000000000..0c2c1fe9dc63b7040bb81006635e50fd528f056f --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.source.type @@ -0,0 +1 @@ +LOCAL \ No newline at end of file diff --git a/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.user b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.user new file mode 100644 index 0000000000000000000000000000000000000000..064b49c9481e2ce4508c64ae068c02be8a068bbb --- /dev/null +++ b/mlruns/0/24c681814a5546c9889f73990b06eea6/tags/mlflow.user @@ -0,0 +1 @@ +Annish \ No newline at end of file diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/meta.yaml b/mlruns/0/5f9014db532e46d8807022080d626f26/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c5df3dcbbec7e12e2fa93e1ed8eedc9d95546f4f --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/meta.yaml @@ -0,0 +1,15 @@ +artifact_uri: file:///C:/Users/Annish/Documents/Mlaas/mlruns/0/5f9014db532e46d8807022080d626f26/artifacts +end_time: 1741369300203 +entry_point_name: '' +experiment_id: '0' +lifecycle_stage: active +run_id: 5f9014db532e46d8807022080d626f26 +run_name: adventurous-rat-262 +run_uuid: 5f9014db532e46d8807022080d626f26 +source_name: '' +source_type: 4 +source_version: '' +start_time: 1741369300198 +status: 3 +tags: [] +user_id: Annish diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.runName b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.runName new file mode 100644 index 0000000000000000000000000000000000000000..0f01e9415c09cab643d8cea8ab63e26a7de05a12 --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.runName @@ -0,0 +1 @@ +adventurous-rat-262 \ No newline at end of file diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.git.commit b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.git.commit new file mode 100644 index 0000000000000000000000000000000000000000..8655f40d42f042ff72b2951145eb40bfd75519e9 --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.git.commit @@ -0,0 +1 @@ +f3cc11642dba9f5288b3fd0c447a031a5e80d786 \ No newline at end of file diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.name b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.name new file mode 100644 index 0000000000000000000000000000000000000000..b063a5c979c1b14802ac9d3b5a8d736c70d02d6c --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.name @@ -0,0 +1 @@ +model/train.py \ No newline at end of file diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.type b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.type new file mode 100644 index 0000000000000000000000000000000000000000..0c2c1fe9dc63b7040bb81006635e50fd528f056f --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.source.type @@ -0,0 +1 @@ +LOCAL \ No newline at end of file diff --git a/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.user b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.user new file mode 100644 index 0000000000000000000000000000000000000000..064b49c9481e2ce4508c64ae068c02be8a068bbb --- /dev/null +++ b/mlruns/0/5f9014db532e46d8807022080d626f26/tags/mlflow.user @@ -0,0 +1 @@ +Annish \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/MLmodel b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/MLmodel new file mode 100644 index 0000000000000000000000000000000000000000..2fd1597f5a4e6791aaf3700b720d54908b56a700 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/MLmodel @@ -0,0 +1,30 @@ +artifact_path: model +flavors: + python_function: + env: + conda: conda.yaml + virtualenv: python_env.yaml + loader_module: mlflow.sklearn + model_path: model.pkl + predict_fn: predict + python_version: 3.10.9 + sklearn: + code: null + pickled_model: model.pkl + serialization_format: cloudpickle + sklearn_version: 1.5.2 +is_signature_from_type_hint: false +mlflow_version: 2.20.3 +model_size_bytes: 172741 +model_uuid: f03866081fda48f991bc9b2c9103fd77 +run_id: be9c34aa8e2246f0839998181f359b4d +saved_input_example_info: + artifact_path: input_example.json + serving_input_path: serving_input_example.json + type: ndarray +signature: + inputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float64", "shape": [-1, 4]}}]' + outputs: '[{"type": "tensor", "tensor-spec": {"dtype": "int32", "shape": [-1]}}]' + params: null +type_hint_from_example: false +utc_time_created: '2025-03-07 17:45:07.365170' diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/conda.yaml b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/conda.yaml new file mode 100644 index 0000000000000000000000000000000000000000..254c1d2843d3abe428458c3de3c8625b27eefd76 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/conda.yaml @@ -0,0 +1,16 @@ +channels: +- conda-forge +dependencies: +- python=3.10.9 +- pip<=22.3.1 +- pip: + - mlflow==2.20.3 + - cloudpickle==2.0.0 + - lz4==3.1.3 + - numpy==1.26.4 + - pandas==1.5.3 + - pathlib==1.0.1 + - psutil==5.9.0 + - scikit-learn==1.5.2 + - scipy==1.14.1 +name: mlflow-env diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/input_example.json b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/input_example.json new file mode 100644 index 0000000000000000000000000000000000000000..8316ef40bd92f5323ec380548118cdfd0590e2e4 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/input_example.json @@ -0,0 +1 @@ +[[6.1, 2.8, 4.7, 1.2]] \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/model.pkl b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..00ace1f7609ff14c9443ed755b6eaf1371d1b18c --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f35da069d5039ea2e169da5591b9351bd23fa7c0b0f1bbdb0b7f421c57c773be +size 172634 diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/python_env.yaml b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/python_env.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f91cc7d7f6722f52aafd49e8570a9faed7e0ab0 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/python_env.yaml @@ -0,0 +1,7 @@ +python: 3.10.9 +build_dependencies: +- pip==22.3.1 +- setuptools==65.6.3 +- wheel==0.38.4 +dependencies: +- -r requirements.txt diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/requirements.txt b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f5344cff29058ecc126ad937030aebd3e30a89e --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/requirements.txt @@ -0,0 +1,9 @@ +mlflow==2.20.3 +cloudpickle==2.0.0 +lz4==3.1.3 +numpy==1.26.4 +pandas==1.5.3 +pathlib==1.0.1 +psutil==5.9.0 +scikit-learn==1.5.2 +scipy==1.14.1 \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/serving_input_example.json b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/serving_input_example.json new file mode 100644 index 0000000000000000000000000000000000000000..6e279f36c1ef33bd6f64905e610eb0e4ac25ae28 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts/model/serving_input_example.json @@ -0,0 +1,10 @@ +{ + "inputs": [ + [ + 6.1, + 2.8, + 4.7, + 1.2 + ] + ] +} \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/meta.yaml b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cf07f18e1f13acc20cc01b369408edbab12c52c7 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/meta.yaml @@ -0,0 +1,15 @@ +artifact_uri: file:///C:/Users/Annish/Documents/Mlaas/mlruns/0/be9c34aa8e2246f0839998181f359b4d/artifacts +end_time: 1741369511518 +entry_point_name: '' +experiment_id: '0' +lifecycle_stage: active +run_id: be9c34aa8e2246f0839998181f359b4d +run_name: sneaky-skink-760 +run_uuid: be9c34aa8e2246f0839998181f359b4d +source_name: '' +source_type: 4 +source_version: '' +start_time: 1741369507349 +status: 3 +tags: [] +user_id: Annish diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/metrics/accuracy b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/metrics/accuracy new file mode 100644 index 0000000000000000000000000000000000000000..906e0141061860c963045d1559a2ec1edaeb1deb --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/metrics/accuracy @@ -0,0 +1 @@ +1741369507365 1.0 0 diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.log-model.history b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.log-model.history new file mode 100644 index 0000000000000000000000000000000000000000..9a9e1040682f272a0f053b32d50b70b660c39f57 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.log-model.history @@ -0,0 +1 @@ +[{"run_id": "be9c34aa8e2246f0839998181f359b4d", "artifact_path": "model", "utc_time_created": "2025-03-07 17:45:07.365170", "model_uuid": "f03866081fda48f991bc9b2c9103fd77", "flavors": {"python_function": {"model_path": "model.pkl", "predict_fn": "predict", "loader_module": "mlflow.sklearn", "python_version": "3.10.9", "env": {"conda": "conda.yaml", "virtualenv": "python_env.yaml"}}, "sklearn": {"pickled_model": "model.pkl", "sklearn_version": "1.5.2", "serialization_format": "cloudpickle", "code": null}}}] \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.runName b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.runName new file mode 100644 index 0000000000000000000000000000000000000000..d01ea90015f3ef8d4be9115dc064f3a5fc3b6ece --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.runName @@ -0,0 +1 @@ +sneaky-skink-760 \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.git.commit b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.git.commit new file mode 100644 index 0000000000000000000000000000000000000000..8655f40d42f042ff72b2951145eb40bfd75519e9 --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.git.commit @@ -0,0 +1 @@ +f3cc11642dba9f5288b3fd0c447a031a5e80d786 \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.name b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.name new file mode 100644 index 0000000000000000000000000000000000000000..b063a5c979c1b14802ac9d3b5a8d736c70d02d6c --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.name @@ -0,0 +1 @@ +model/train.py \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.type b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.type new file mode 100644 index 0000000000000000000000000000000000000000..0c2c1fe9dc63b7040bb81006635e50fd528f056f --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.source.type @@ -0,0 +1 @@ +LOCAL \ No newline at end of file diff --git a/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.user b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.user new file mode 100644 index 0000000000000000000000000000000000000000..064b49c9481e2ce4508c64ae068c02be8a068bbb --- /dev/null +++ b/mlruns/0/be9c34aa8e2246f0839998181f359b4d/tags/mlflow.user @@ -0,0 +1 @@ +Annish \ No newline at end of file diff --git a/mlruns/0/meta.yaml b/mlruns/0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e62c72e73c77edf2a59fa0187f567a1f9e014599 --- /dev/null +++ b/mlruns/0/meta.yaml @@ -0,0 +1,6 @@ +artifact_location: file:///C:/Users/Annish/Documents/Mlaas/mlruns/0 +creation_time: 1741369299273 +experiment_id: '0' +last_update_time: 1741369299273 +lifecycle_stage: active +name: Default diff --git a/model/model.pkl b/model/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ef04674c78b85d780811512bde67b8399e5b9776 --- /dev/null +++ b/model/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:884d083100ccc6e7bfd9f8af71c218b821b0484c7377137997b2b318e1a66c69 +size 181809 diff --git a/model/train.py b/model/train.py new file mode 100644 index 0000000000000000000000000000000000000000..36248b5ce751e629a36529aa081713c74696074a --- /dev/null +++ b/model/train.py @@ -0,0 +1,25 @@ +from sklearn.datasets import load_iris +from sklearn.model_selection import train_test_split +from sklearn.ensemble import RandomForestClassifier +import joblib +import mlflow +import numpy as np +# Load dataset +data = load_iris() +X_train, X_test, y_train, y_test = train_test_split(data.data, data.target, test_size=0.2, random_state=42) + +input_example = np.array([X_test[0]]) +# Train the model +model = RandomForestClassifier(n_estimators=100) +model.fit(X_train, y_train) +accuracy = model.score(X_test, y_test) +mlflow.start_run() +mlflow.log_metric("accuracy", accuracy) +mlflow.sklearn.log_model(model, "model", input_example=input_example) +mlflow.end_run() +<<<<<<< HEAD +#this is pushed to github +======= +>>>>>>> 7406396a4ff708543244d85f087a3cc86f1fc22a +# Save the model +joblib.dump(model, "model/model.pkl") \ No newline at end of file diff --git a/tests/test.py b/tests/test.py new file mode 100644 index 0000000000000000000000000000000000000000..927fc5abb330399de7c39a614e9cf4091f2035f3 --- /dev/null +++ b/tests/test.py @@ -0,0 +1,2 @@ +def test_placeholder(): + assert True \ No newline at end of file