Skip to content

Instantly share code, notes, and snippets.

View rahuljantwal-8451's full-sized avatar

Rahul Jantwal rahuljantwal-8451

View GitHub Profile
@rahuljantwal-8451
rahuljantwal-8451 / encode.sh
Created October 3, 2024 21:01
Requests to triton server with ensemble model
#!/bin/bash
# Define variables
TRITON_URL="localhost:8000"
MODEL_NAME="executor_model"
MODEL_VERSION="1"
# Create JSON payload
PAYLOAD=$(cat <<EOF
{
@rahuljantwal-8451
rahuljantwal-8451 / export_ensemble.py
Created October 3, 2024 21:00
Export the ensemble model to deploy on triton
from merlin.systems.dag.ops.workflow import TransformWorkflow
from merlin.systems.dag.ensemble import Ensemble
import nvtabular as nvt
import os
BASE_DIR = "."
if not os.path.isdir(os.path.join(BASE_DIR, 'ensemble')):
os.makedirs(os.path.join(BASE_DIR, 'ensemble'))
@rahuljantwal-8451
rahuljantwal-8451 / process_dataset.py
Created October 3, 2024 20:59
Process Dataset using NVTabular
import argparse
import os
import nvtabular as nvt
from nvtabular import ops
from merlin.io import Dataset
from merlin.dag.ops.subgraph import Subgraph
def parse_args():
parser = argparse.ArgumentParser(description='Process the generated dataset using NVTabular')
parser.add_argument('--input_path', type=str, default='./data/simulated/source_dataset/*.parquet', help='Input dataset path')
@rahuljantwal-8451
rahuljantwal-8451 / generate_dataset.py
Last active October 3, 2024 21:17
Generate High Cardinality Data
import pandas as pd
import numpy as np
import pyarrow.parquet as pq
from tqdm import tqdm
import os
import argparse
def parse_args():
parser = argparse.ArgumentParser(description='Generate a large categorical dataset')
parser.add_argument('--col1_cardinality', type=int, default=50_000_000, help='Cardinality of column 1')