Skip to content

Commit

Permalink
Fixed issue with components repo
Browse files Browse the repository at this point in the history
  • Loading branch information
fadnavismehul committed Aug 6, 2022
1 parent e7020a1 commit 6e377ff
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions components/get_data/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dependencies:
- pip:
- wandb==0.12.17
- git+https://github.com/udacity/nd0821-c2-build-model-workflow-starter.git#egg=wandb-utils&subdirectory=components
# - git+https://github.com/fadnavismehul/build-ml-pipeline-for-short-term-rental-prices.git#egg=wandb-utils&subdirectory=components
27 changes: 21 additions & 6 deletions components/get_data/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os

import wandb
print(wandb.__path__)

from wandb_utils.log_artifact import log_artifact

Expand All @@ -21,14 +22,28 @@ def go(args):

logger.info(f"Returning sample {args.sample}")
logger.info(f"Uploading {args.artifact_name} to Weights & Biases")
log_artifact(
args.artifact_name,
args.artifact_type,
args.artifact_description,
os.path.join("data", args.sample),
run,

artifact = wandb.Artifact(
name=args.artifact_name,
type=args.artifact_type,
description=args.artifact_description
)

artifact.add_file(os.path.join("data", args.sample))

run.log_artifact(artifact)
artifact.wait()



# log_artifact(
# args.artifact_name,
# args.artifact_type,
# args.artifact_description,
# os.path.join("data", args.sample),
# run,
# )


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Download URL to a local destination")
Expand Down
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main:
# components_repository: "https://github.com/udacity/build-ml-pipeline-for-short-term-rental-prices/tree/main/components"
components_repository: "/Users/mehul.fadnavis/Desktop/Personal/ML NanoDegree/Code/build-ml-pipeline-for-short-term-rental-prices/components"
components_repository: "https://github.com/fadnavismehul/build-ml-pipeline-for-short-term-rental-prices.git#components"
# components_repository: "/Users/mehul.fadnavis/Desktop/Personal/ML NanoDegree/Code/build-ml-pipeline-for-short-term-rental-prices/components"
# All the intermediate files will be copied to this directory at the end of the run.
# Set this to null if you are running in prod
project_name: nyc_airbnb
Expand Down
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def go(config: DictConfig):
# Download file and load in W&B
_ = mlflow.run(
f"{config['main']['components_repository']}/get_data",
"main",
entry_point="main",
version="main",
parameters={
"sample": config["etl"]["sample"],
"artifact_name": "sample.csv",
Expand Down

0 comments on commit 6e377ff

Please sign in to comment.