reponame stringclasses 5
values | filepath stringlengths 15 64 | content stringlengths 63 24.6k |
|---|---|---|
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | custom_components/batch_pred_evaluator.py | """
This component evaluates the performance of a currently deployed model, and
the evaluation is based on the result of batch prediction on Vertex AI from the previous component.
At the end, this component will output true or false to indicate if retraining is needed.
Reference: https://bit.ly/vertex-batch
"""
from ... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | custom_components/batch_prediction_vertex.py | """
This component launches a Batch Prediction job on Vertex AI.
Know more about Vertex AI Batch Predictions jobs, go here:
https://cloud.google.com/vertex-ai/docs/predictions/batch-predictions.
"""
from google.cloud import storage
from tfx.dsl.component.experimental.annotations import Parameter, InputArtifact
from t... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | custom_components/file_list_gen.py | """
Generate a txt file formatted required by Vertex AI's Batch Prediction
There are few options, and this component generate "file list" formatted txt.
(https://cloud.google.com/vertex-ai/docs/predictions/batch-predictions)
"""
import tensorflow as tf
from absl import logging
from tfx.dsl.component.experimental.deco... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | custom_components/span_preparator.py | """
This component is responsible for separating provided samples into training and
validation splits. It then converts them to TFRecords and stores those inside
a GCS location. Finally, it returns the latest span id calculated from the current
samples in `gcs_source_bucket`.
"""
from tfx.dsl.component.experimental.de... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | custom_components/training_pipeline_trigger.py | """
Component responsible for triggering a training job given a pipeline specification.
"""
import json
from google.cloud import storage
from kfp.v2.google.client import AIPlatformClient
from tfx.dsl.component.experimental.annotations import Parameter, InputArtifact
from tfx.dsl.component.experimental.decorators imp... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | notebooks/01_Dataset_Prep.ipynb | from google.colab import auth
auth.authenticate_user()TARGET_ROOT_DIR = "cifar10"
TARGET_TRAIN_DIR = TARGET_ROOT_DIR + "/span-1/train"
TARGET_TEST_DIR = TARGET_ROOT_DIR + "/span-1/test"
!mkdir -p {TARGET_TRAIN_DIR}
!mkdir -p {TARGET_TEST_DIR}import tensorflow_datasets as tfds
# Generate TFRecords with TFDS
builder =... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | notebooks/02_TFX_Training_Pipeline.ipynb | from google.colab import auth
auth.authenticate_user()import tensorflow as tf
print("TensorFlow version: {}".format(tf.__version__))
from tfx import v1 as tfx
print("TFX version: {}".format(tfx.__version__))
import kfp
print("KFP version: {}".format(kfp.__version__))
from google.cloud import aiplatform as vertex_ai... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | notebooks/03_Batch_Prediction_Pipeline.ipynb | from google.colab import auth
auth.authenticate_user()# @title
from fastdot.core import *
tfx_components = [
"FileListGen",
"BatchPredictionGen",
"PerformanceEvaluator",
"SpanPreparator",
"PipelineTrigger",
]
block = "TFX Component Workflow"
g = graph_items(seq_cluster(tfx_components, block))
g_f... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | notebooks/04_Cloud_Scheduler_Trigger.ipynb | from google.colab import auth
auth.authenticate_user()GOOGLE_CLOUD_PROJECT = "gcp-ml-172005" # @param {type:"string"}
GOOGLE_CLOUD_REGION = "us-central1"
GCS_BUCKET_NAME = "cifar10-experimental-csp2" # @param {type:"string"}
PIPELINE_NAME = "continuous-adaptation-for-data-changes-batch" # @param {type:"string"}
PI... |
deep-diver/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | notebooks/98_Batch_Prediction_Test.ipynb | from google.colab import auth
auth.authenticate_user()GOOGLE_CLOUD_PROJECT = "central-hangar-321813" # @param {type:"string"}
GOOGLE_CLOUD_REGION = "us-central1" # @param {type:"string"}
MODEL_NAME = "resnet_cifar_latest" # @param {type:"string"}
TEST_FILENAME = "test-images.txt" # @param {type:"string"}
TEST_GC... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/kubeflow_runner.py | from absl import logging
from tfx import v1 as tfx
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner as runner
from pipeline import configs
from pipeline import kubeflow_pipeline
def run():
runner_config = runner.KubeflowV2DagRunnerConfig(
default_image=configs.PIPELINE_IMAGE
)
r... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/local_runner.py | import os
from absl import logging
from tfx import v1 as tfx
from pipeline import configs
from pipeline import local_pipeline
OUTPUT_DIR = "."
PIPELINE_ROOT = os.path.join(OUTPUT_DIR, "tfx_pipeline_output", configs.PIPELINE_NAME)
METADATA_PATH = os.path.join(
OUTPUT_DIR, "tfx_metadata", configs.PIPELINE_NAME, "m... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/kubeflow_runner.py | from absl import logging
from tfx import v1 as tfx
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner as runner
from tfx.proto import tuner_pb2
from pipeline import configs
from pipeline import kubeflow_pipeline
def run():
runner_config = runner.KubeflowV2DagRunnerConfig(
default_image=con... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/local_runner.py | import os
from absl import logging
from tfx import v1 as tfx
from pipeline import configs
from pipeline import local_pipeline
OUTPUT_DIR = "."
PIPELINE_ROOT = os.path.join(OUTPUT_DIR, "tfx_pipeline_output", configs.PIPELINE_NAME)
METADATA_PATH = os.path.join(
OUTPUT_DIR, "tfx_metadata", configs.PIPELINE_NAME, "m... |
deep-diver/mlops-hf-tf-vision-models | basic/kubeflow_runner.py | from absl import logging
from tfx import v1 as tfx
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner as runner
from pipeline import configs
from pipeline import kubeflow_pipeline
def run():
runner_config = runner.KubeflowV2DagRunnerConfig(
default_image=configs.PIPELINE_IMAGE
)
r... |
deep-diver/mlops-hf-tf-vision-models | basic/local_runner.py | import os
from absl import logging
from tfx import v1 as tfx
from pipeline import configs
from pipeline import local_pipeline
OUTPUT_DIR = "."
PIPELINE_ROOT = os.path.join(OUTPUT_DIR, "tfx_pipeline_output", configs.PIPELINE_NAME)
METADATA_PATH = os.path.join(
OUTPUT_DIR, "tfx_metadata", configs.PIPELINE_NAME, "m... |
deep-diver/mlops-hf-tf-vision-models | dataset/create_tfrecords.py | """
Script to generate TFRecord shards from the Sidewalks dataset as shown in this
blog post: https://huggingface.co/blog/fine-tune-segformer.
The recommended way to obtain TFRecord shards is via an Apache Beam
Pipeline with an execution runner like Dataflow. Example:
https://github.com/GoogleCloudPlatform/practical-m... |
deep-diver/mlops-hf-tf-vision-models | hf_integration/kubeflow_runner.py | from absl import logging
from tfx import v1 as tfx
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner as runner
from tfx.proto import tuner_pb2
from pipeline import configs
from pipeline import kubeflow_pipeline
def run():
runner_config = runner.KubeflowV2DagRunnerConfig(
default_image=con... |
deep-diver/mlops-hf-tf-vision-models | hf_integration/local_runner.py | import os
from absl import logging
from tfx import v1 as tfx
from pipeline import configs
from pipeline import local_pipeline
OUTPUT_DIR = "."
PIPELINE_ROOT = os.path.join(OUTPUT_DIR, "tfx_pipeline_output", configs.PIPELINE_NAME)
METADATA_PATH = os.path.join(
OUTPUT_DIR, "tfx_metadata", configs.PIPELINE_NAME, "m... |
deep-diver/mlops-hf-tf-vision-models | intermediate/kubeflow_runner.py | from absl import logging
from tfx import v1 as tfx
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner as runner
from pipeline import configs
from pipeline import kubeflow_pipeline
def run():
runner_config = runner.KubeflowV2DagRunnerConfig(
default_image=configs.PIPELINE_IMAGE
)
r... |
deep-diver/mlops-hf-tf-vision-models | intermediate/local_runner.py | import os
from absl import logging
from tfx import v1 as tfx
from pipeline import configs
from pipeline import local_pipeline
OUTPUT_DIR = "."
PIPELINE_ROOT = os.path.join(OUTPUT_DIR, "tfx_pipeline_output", configs.PIPELINE_NAME)
METADATA_PATH = os.path.join(
OUTPUT_DIR, "tfx_metadata", configs.PIPELINE_NAME, "m... |
deep-diver/mlops-hf-tf-vision-models | notebooks/advanced_part1.ipynb | data_path = "gs://beans-lowres/tfrecords"
local_data_path = "data"
model_file = "modules/model.py"
model_fn = "modules.model.run_fn"
proprocessing_file = "modules/preprocessing.py"
preprocessing_fn = "modules.preprocessing.preprocessing_fn"
schema_file = "schema.pbtxt"import tfx
tfx.__version__from tfx import v1 as ... |
deep-diver/mlops-hf-tf-vision-models | notebooks/advanced_part2.ipynb | data_path = "gs://beans-lowres/tfrecords"
local_data_path = "data"
model_file = "modules/model.py"
model_fn = "modules.model.run_fn"
tuner_fn = "modules.model.tuner_fn"
proprocessing_file = "modules/preprocessing.py"
preprocessing_fn = "modules.preprocessing.preprocessing_fn"
schema_file = "schema.pbtxt"import tfx
t... |
deep-diver/mlops-hf-tf-vision-models | notebooks/basic.ipynb | data_path = "gs://beans-lowres/tfrecords"
local_data_path = "data"
model_file = "modules/model.py"
model_fn = "modules.model.run_fn"import tfx
tfx.__version__from tfx import v1 as tfx
from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext
from tfx.components import ImportExampleG... |
deep-diver/mlops-hf-tf-vision-models | notebooks/intermediate.ipynb | data_path = "gs://beans-lowres/tfrecords"
local_data_path = "data"
model_file = "modules/model.py"
model_fn = "modules.model.run_fn"
proprocessing_file = "modules/preprocessing.py"
preprocessing_fn = "modules.preprocessing.preprocessing_fn"
schema_file = "schema.pbtxt"import tfx
tfx.__version__from tfx import v1 as ... |
deep-diver/mlops-hf-tf-vision-models | notebooks/parse_tfrecord.ipynb | import tensorflow as tfGCS_PATH_FULL_RESOUTION = "gs://beans-fullres/tfrecords"
GCS_PATH_LOW_RESOLUTION = "gs://beans-lowres/tfrecords"BATCH_SIZE = 4
AUTO = tf.data.AUTOTUNEdef parse_tfr(proto):
feature_description = {
"image": tf.io.VarLenFeature(tf.float32),
"image_shape": tf.io.VarLenFeature(tf.i... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/ViT.py | import tensorflow as tf
from transformers import TFViTForImageClassification
from .common import LABELS
from .common import PRETRAIN_CHECKPOINT
from .utils import INFO
def build_model():
id2label = {str(i): c for i, c in enumerate(LABELS)}
label2id = {c: str(i) for i, c in enumerate(LABELS)}
model = TFV... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/common.py | IMAGE_TFREC_KEY = "image"
IMAGE_SHAPE_TFREC_KEY = "image_shape"
LABEL_TFREC_KEY = "label"
MODEL_INPUT_IMAGE_KEY = "pixel_values"
MODEL_INPUT_LABEL_KEY = "labels"
IMAGE_MODEL_KEY = "pixel_values"
LABEL_MODEL_KEY = "labels"
CONCRETE_INPUT = "pixel_values"
PRETRAIN_CHECKPOINT = "google/vit-base-patch16-224-in21k"
LABE... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/hyperparams.py | EPOCHS = 1
BATCH_SIZE = 32
TRAIN_BATCH_SIZE = 32
EVAL_BATCH_SIZE = 32
TRAIN_LENGTH = 1034
EVAL_LENGTH = 128
INPUT_IMG_SIZE = 224
|
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/preprocessing.py | import tensorflow as tf
from .common import IMAGE_TFREC_KEY, LABEL_TFREC_KEY
from .common import IMAGE_MODEL_KEY, LABEL_MODEL_KEY
from .hyperparams import INPUT_IMG_SIZE
def preprocessing_fn(inputs):
"""tf.transform's callback function for preprocessing inputs.
Args:
inputs: map from feature keys to raw... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/signatures.py | from typing import Dict
import tensorflow as tf
import tensorflow_transform as tft
from transformers import ViTFeatureExtractor
from .common import PRETRAIN_CHECKPOINT
from .common import CONCRETE_INPUT
from .common import LABEL_MODEL_KEY
feature_extractor = ViTFeatureExtractor.from_pretrained(PRETRAIN_CHECKPOINT)
... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/train.py | import tensorflow_transform as tft
from tfx.components.trainer.fn_args_utils import FnArgs
from .train_data import input_fn
from .ViT import build_model
from .signatures import (
model_exporter,
transform_features_signature,
tf_examples_serving_signature,
)
from .hyperparams import TRAIN_BATCH_SIZE, EVAL_... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/train_data.py | from typing import List
import tensorflow as tf
import tensorflow_transform as tft
from tfx_bsl.tfxio import dataset_options
from tfx.components.trainer.fn_args_utils import DataAccessor
from .utils import INFO
from .common import LABEL_MODEL_KEY
from .hyperparams import BATCH_SIZE
def input_fn(
file_pattern: ... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/modules/utils.py | import absl
def INFO(text: str):
absl.logging.info(text)
|
deep-diver/mlops-hf-tf-vision-models | advanced_part1/pipeline/configs.py | import os
import tensorflow_model_analysis as tfma
import tfx.extensions.google_cloud_ai_platform.constants as vertex_const
import tfx.extensions.google_cloud_ai_platform.trainer.executor as vertex_training_const
PIPELINE_NAME = "vit-e2e-pipeline-advanced-part1"
try:
import google.auth # pylint: disable=g-import... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/pipeline/kubeflow_pipeline.py | from typing import Any, Dict, List, Optional, Text
import tensorflow_model_analysis as tfma
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.components import StatisticsGen
from tfx.components import... |
deep-diver/mlops-hf-tf-vision-models | advanced_part1/pipeline/local_pipeline.py | from typing import Dict, Optional, Text
import tensorflow_model_analysis as tfma
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.components import StatisticsGen
from tfx.components import ExampleVal... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/ViT.py | import tensorflow as tf
import keras_tuner
from transformers import TFViTForImageClassification
from .common import LABELS
from .common import PRETRAIN_CHECKPOINT
from .utils import INFO
def build_model(hparams: keras_tuner.HyperParameters):
id2label = {str(i): c for i, c in enumerate(LABELS)}
label2id = {c:... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/common.py | IMAGE_TFREC_KEY = "image"
IMAGE_SHAPE_TFREC_KEY = "image_shape"
LABEL_TFREC_KEY = "label"
MODEL_INPUT_IMAGE_KEY = "pixel_values"
MODEL_INPUT_LABEL_KEY = "labels"
IMAGE_MODEL_KEY = "pixel_values"
LABEL_MODEL_KEY = "labels"
CONCRETE_INPUT = "pixel_values"
PRETRAIN_CHECKPOINT = "google/vit-base-patch16-224-in21k"
LABE... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/hyperparams.py | import keras_tuner
EPOCHS = 10
BATCH_SIZE = 32
TRAIN_BATCH_SIZE = 32
EVAL_BATCH_SIZE = 32
TRAIN_LENGTH = 1034
EVAL_LENGTH = 128
INPUT_IMG_SIZE = 224
def get_hyperparameters(hyperparameters) -> keras_tuner.HyperParameters:
hp_set = keras_tuner.HyperParameters()
for hp in hyperparameters:
hp_set.Ch... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/preprocessing.py | import tensorflow as tf
from .common import IMAGE_TFREC_KEY, LABEL_TFREC_KEY
from .common import IMAGE_MODEL_KEY, LABEL_MODEL_KEY
from .hyperparams import INPUT_IMG_SIZE
def preprocessing_fn(inputs):
"""tf.transform's callback function for preprocessing inputs.
Args:
inputs: map from feature keys to raw... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/signatures.py | from typing import Dict
import tensorflow as tf
import tensorflow_transform as tft
from transformers import ViTFeatureExtractor
from .common import PRETRAIN_CHECKPOINT
from .common import CONCRETE_INPUT
from .common import LABEL_MODEL_KEY
feature_extractor = ViTFeatureExtractor.from_pretrained(PRETRAIN_CHECKPOINT)
... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/train.py | import keras_tuner
import tensorflow_transform as tft
from tfx.components.trainer.fn_args_utils import FnArgs
from .train_data import input_fn
from .ViT import build_model
from .signatures import (
model_exporter,
transform_features_signature,
tf_examples_serving_signature,
)
from .hyperparams import TRAI... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/train_data.py | from typing import List
import tensorflow as tf
import tensorflow_transform as tft
from tfx_bsl.tfxio import dataset_options
from tfx.components.trainer.fn_args_utils import DataAccessor
from .utils import INFO
from .common import LABEL_MODEL_KEY
from .hyperparams import BATCH_SIZE
def input_fn(
file_pattern: ... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/tuning.py | import keras_tuner
import tensorflow_transform as tft
from tfx.components.trainer.fn_args_utils import FnArgs
from tfx.v1.components import TunerFnResult
from .train_data import input_fn
from .ViT import build_model
from .hyperparams import TRAIN_BATCH_SIZE, EVAL_BATCH_SIZE
from .hyperparams import TRAIN_LENGTH, EVAL... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/modules/utils.py | import absl
def INFO(text: str):
absl.logging.info(text)
|
deep-diver/mlops-hf-tf-vision-models | advanced_part2/pipeline/configs.py | import os
import tensorflow_model_analysis as tfma
import tfx.extensions.google_cloud_ai_platform.constants as vertex_const
import tfx.extensions.google_cloud_ai_platform.trainer.executor as vertex_training_const
import tfx.extensions.google_cloud_ai_platform.tuner.executor as vertex_tuner_const
PIPELINE_NAME = "vit-e... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/pipeline/kubeflow_pipeline.py | from typing import Any, Dict, List, Optional, Text
import tensorflow_model_analysis as tfma
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.components import StatisticsGen
from tfx.components import... |
deep-diver/mlops-hf-tf-vision-models | advanced_part2/pipeline/local_pipeline.py | from typing import Dict, Optional, Text
import tensorflow_model_analysis as tfma
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.components import StatisticsGen
from tfx.components import ExampleVal... |
deep-diver/mlops-hf-tf-vision-models | basic/modules/ViT.py | import tensorflow as tf
from transformers import TFViTForImageClassification
from .common import LABELS
from .common import PRETRAIN_CHECKPOINT
from .utils import INFO
def build_model():
id2label = {str(i): c for i, c in enumerate(LABELS)}
label2id = {c: str(i) for i, c in enumerate(LABELS)}
model = TFV... |
deep-diver/mlops-hf-tf-vision-models | basic/modules/common.py | IMAGE_TFREC_KEY = "image"
IMAGE_SHAPE_TFREC_KEY = "image_shape"
LABEL_TFREC_KEY = "label"
IMAGE_MODEL_KEY = "pixel_values"
LABEL_MODEL_KEY = "labels"
CONCRETE_INPUT = "pixel_values"
PRETRAIN_CHECKPOINT = "google/vit-base-patch16-224-in21k"
LABELS = ["angular_leaf_spot", "bean_rust", "healthy"]
|
deep-diver/mlops-hf-tf-vision-models | basic/modules/hyperparams.py | EPOCHS = 1
BATCH_SIZE = 32
TRAIN_BATCH_SIZE = 32
EVAL_BATCH_SIZE = 32
TRAIN_LENGTH = 1034
EVAL_LENGTH = 128
|
deep-diver/mlops-hf-tf-vision-models | basic/modules/signatures.py | import tensorflow as tf
from transformers import ViTFeatureExtractor
from .common import PRETRAIN_CHECKPOINT
from .common import CONCRETE_INPUT
feature_extractor = ViTFeatureExtractor.from_pretrained(PRETRAIN_CHECKPOINT)
def _normalize_img(
img, mean=feature_extractor.image_mean, std=feature_extractor.image_std... |
deep-diver/mlops-hf-tf-vision-models | basic/modules/train.py | from tfx.components.trainer.fn_args_utils import FnArgs
from .train_data import input_fn
from .ViT import build_model
from .signatures import model_exporter
from .hyperparams import TRAIN_BATCH_SIZE, EVAL_BATCH_SIZE
from .hyperparams import TRAIN_LENGTH, EVAL_LENGTH
from .hyperparams import EPOCHS
def run_fn(fn_arg... |
deep-diver/mlops-hf-tf-vision-models | basic/modules/train_data.py | from typing import List
import tensorflow as tf
from .utils import INFO
from .common import IMAGE_TFREC_KEY, IMAGE_SHAPE_TFREC_KEY, LABEL_TFREC_KEY
from .common import IMAGE_MODEL_KEY, LABEL_MODEL_KEY
from .hyperparams import BATCH_SIZE
def _parse_tfr(proto):
feature_description = {
IMAGE_TFREC_KEY: tf.... |
deep-diver/mlops-hf-tf-vision-models | basic/modules/utils.py | import absl
def INFO(text: str):
absl.logging.info(text)
|
deep-diver/mlops-hf-tf-vision-models | basic/pipeline/configs.py | import os # pylint: disable=unused-import
import tfx.extensions.google_cloud_ai_platform.constants as vertex_const
import tfx.extensions.google_cloud_ai_platform.trainer.executor as vertex_training_const
PIPELINE_NAME = "vit-e2e-pipeline-basic"
try:
import google.auth # pylint: disable=g-import-not-at-top # py... |
deep-diver/mlops-hf-tf-vision-models | basic/pipeline/kubeflow_pipeline.py | from typing import Any, Dict, List, Optional, Text
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.extensions.google_cloud_ai_platform.trainer.component import (
Trainer as VertexTrainer,
)
from ... |
deep-diver/mlops-hf-tf-vision-models | basic/pipeline/local_pipeline.py | from typing import Dict, Optional, Text
from tfx import v1 as tfx
from ml_metadata.proto import metadata_store_pb2
from tfx.proto import example_gen_pb2
from tfx.components import ImportExampleGen
from tfx.components import Trainer
from tfx.components import Pusher
from tfx.orchestration import pipeline
from tfx.pro... |
deep-diver/mlops-hf-tf-vision-models | hf_integration/modules/ViT.py | import tensorflow as tf
import keras_tuner
from transformers import TFViTForImageClassification
from .common import LABELS
from .common import PRETRAIN_CHECKPOINT
from .utils import INFO
def build_model(hparams: keras_tuner.HyperParameters):
id2label = {str(i): c for i, c in enumerate(LABELS)}
label2id = {c:... |
End of preview. Expand in Data Studio
- Downloads last month
- 15