Skip to content

Commit

Permalink
Merge pull request #8 from zenml-io/fix/update-req-fix-lint
Browse files Browse the repository at this point in the history
update requirement and fix lint and format
  • Loading branch information
safoinme authored Nov 29, 2023
2 parents 0cf04fa + 371d743 commit 7d308a5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion template/gradio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def analyze_text(text):
scores_ = output[0][0].detach().numpy()
scores_ = softmax(scores_)

scores = {l: float(s) for (l, s) in zip(labels, scores_)}
scores = {label: float(score) for (label, score) in zip(labels, scores_)}
return scores

demo = gr.Interface(
Expand Down
2 changes: 0 additions & 2 deletions template/pipelines/deploying.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ def {{product_name}}_deploy_pipeline(
### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ###
# Link all the steps together by calling them and passing the output
# of one step as the input of the next step.
pipeline_extra = get_pipeline_context().extra

########## Save Model locally ##########
save_model_to_deploy()

Expand Down
2 changes: 0 additions & 2 deletions template/pipelines/promoting.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def {{product_name}}_promote_pipeline():
### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ###
# Link all the steps together by calling them and passing the output
# of one step as the input of the next step.
pipeline_extra = get_pipeline_context().extra

########## Promotion stage ##########
{%- if metric_compare_promotion %}
latest_metrics, current_metrics = promote_get_metrics()
Expand Down
2 changes: 0 additions & 2 deletions template/pipelines/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def {{product_name}}_training_pipeline(
### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ###
# Link all the steps together by calling them and passing the output
# of one step as the input of the next step.
pipeline_extra = get_pipeline_context().extra

########## Load Dataset stage ##########
dataset = data_loader()

Expand Down
2 changes: 1 addition & 1 deletion template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
torchvision
accelerate
gradio
zenml[server]==0.47.0
zenml[server]==0.50.0
4 changes: 2 additions & 2 deletions template/steps/dataset_loader/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def data_loader(
The loaded dataset artifact.
"""
### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ###
logger.info(f"Loading dataset {{dataset}}... ")
logger.info("Loading dataset {{dataset}}... ")

# Load dataset based on the dataset value
{%- if dataset == 'financial_news' %}
Expand Down Expand Up @@ -61,7 +61,7 @@ def sample_dataset(dataset, sample_rate=0.2):
logger.info(dataset)
logger.info(f"Sample Example 1 : {dataset['train'][0]['text']} with label {dataset['train'][0]['label']}")
logger.info(f"Sample Example 1 : {dataset['train'][1]['text']} with label {dataset['train'][1]['label']}")
logger.info(f" Dataset Loaded Successfully")
logger.info("Dataset Loaded Successfully")
### YOUR CODE ENDS HERE ###

return dataset

0 comments on commit 7d308a5

Please sign in to comment.