Giter Club home page Giter Club logo

simple-dvc-demo's Introduction

create env

conda create -n wineq python=3.7 -y

activate env

conda activate wineq

created a req file

install the req

pip install -r requirements.txt

download the data from

https://drive.google.com/drive/folders/18zqQiCJVgF7uzXgfbIJ-04zgz1ItNfF5?usp=sharing

git init
dvc init 
dvc add data_given/winequality.csv
git add .
git commit -m "first commit"

oneliner updates for readme

git add . && git commit -m "update Readme.md"
git remote add origin https://github.com/c17hawke/simple-dvc-demo.git
git branch -M main
git push origin main

tox command -

tox

for rebuilding -

tox -r 

pytest command

pytest -v

setup commands -

pip install -e . 

build your own package commands-

python setup.py sdist bdist_wheel

simple-dvc-demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

simple-dvc-demo's Issues

I have run into a problem

In the conftest.py file:

import pytest
import yaml
import os
import json

@pytest.fixture
def config(config_path="params.yaml"):
with open(config_path) as yaml_file:
config = yaml.safe_load(yaml_file)
return config

@pytest.fixture
def schema_in(schema_path="schema_in.json"):
with open(schema_path) as json_file:
schema = json.load(json_file)
return schema

when i push it to github in Action get the error:

yaml error

please help

Facing error for dvc repro after log_production_model.py file creation..

here is the code log_production_model.py file

from src.get_data import read_params
import argparse
import mlflow
from mlflow.tracking import MlflowClient
from pprint import pprint
import joblib
import os

def log_production_model(config_path):
config = read_params(config_path)

mlflow_config = config["mlflow_config"] 


model_name = mlflow_config["registered_model_name"]


remote_server_uri = mlflow_config["remote_server_uri"]

mlflow.set_tracking_uri(remote_server_uri)


runs = mlflow.search_runs(experiment_ids=1)
lowest = runs["metrics.mae"].sort_values(ascending=True)[0]
lowest_run_id = runs[runs["metrics.mae"] == lowest]["run_id"][0]


client = MlflowClient()
for mv in client.search_model_versions(f"name='{model_name}'"):
    mv = dict(mv)
    
    if mv["run_id"] == lowest_run_id:
        current_version = mv["version"]
        logged_model = mv["source"]
        pprint(mv, indent=4)
        client.transition_model_version_stage(
            name=model_name,
            version=current_version,
            stage="Production"
        )
    else:
        current_version = mv["version"]
        client.transition_model_version_stage(
            name=model_name,
            version=current_version,
            stage="Staging"
        )        


loaded_model = mlflow.pyfunc.load_model(logged_model)

model_path = config["webapp_model_dir"] #"prediction_service/model"

joblib.dump(loaded_model, model_path)

if name == 'main':
args = argparse.ArgumentParser()
args.add_argument("--config", default="params.yaml")
parsed_args = args.parse_args()
data = log_production_model(config_path=parsed_args.config)

Here the error which i am getting when i try to run dvc repro.. i think in video tutorial you were also faced the same issue but i don't how did you solve.. please help me out.

Screenshot (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.