Skip to content

Instantly share code, notes, and snippets.

View tedhtchang's full-sized avatar

ted chang tedhtchang

  • IBM
  • United States
View GitHub Profile
@tedhtchang
tedhtchang / kserve-custom.py
Created September 8, 2023 01:10
KServe custom model runtime example
import base64
import io
from PIL import Image
from torchvision import models, transforms
from typing import Dict
import torch
from kserve import Model, ModelServer
class AlexNetModel(Model):
def __init__(self):
@tedhtchang
tedhtchang / Kserve-custom-rayserve.py
Created September 8, 2023 01:19
Ray Serve enabled KServe custom runtime
import base64
import io
from PIL import Image
from torchvision import models, transforms
from typing import Dict
import torch
from kserve import Model, ModelServer
from ray import serve
@serve.deployment(name="custom-model", num_replicas=1)
@tedhtchang
tedhtchang / gist:a5205a346bf7b1ab50f0633e792e4131
Last active October 4, 2023 22:37
local_interactive_aw.yaml
apiVersion: workload.codeflare.dev/v1beta1
kind: AppWrapper
metadata:
name: hfgputest-1
namespace: default
spec:
priority: 9
resources:
GenericItems:
- custompodresources:
@tedhtchang
tedhtchang / gist:8851be46742969feaf763c0150e24444
Last active October 10, 2023 19:28
raycluster-different-namespace.yaml
apiVersion: ray.io/v1alpha1
kind: RayCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
# A unique identifier for the head node and workers of this cluster.
name: raycluster-complete
spec:
rayVersion: '2.7.0'
# Ray head pod configuration
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mcad-controller-ray-clusterrole
rules:
- apiGroups:
- ray.io
resources:
- rayclusters
- rayclusters/finalizers
@tedhtchang
tedhtchang / kind-e2e-sft-mini.sh
Last active May 2, 2024 18:37
kind-e2e-sft-mini.sh
#!/bin/bash
# Copyright 2022 IBM, Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#