Skip to content

Instantly share code, notes, and snippets.

import requests
import json
def make_request(model_server, input_data, token=None):
"""
Sends a request to the model server and returns the response.
"""
headers = {"Content-Type": "application/json"}
if token:
@pandeybk
pandeybk / .yaml
Last active September 22, 2024 23:41
nmstate-config.yaml
interfaces:
- name: bond0
description: Bond
type: bond
state: up
mtu: 1500
ipv4:
address:
- ip: 192.168.7.101
prefix-length: 24
@pandeybk
pandeybk / Containerfile
Last active May 6, 2024 19:58
redhat-openshift-ai-notebooks-as-sudo-user
FROM registry.access.redhat.com/ubi8/python-39:1-176.1712880517
LABEL name="workbench-images:cuda-jupyter-pytorch-c9s-py39_2024b_20240418" \
summary="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
description="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
io.k8s.description="cuda-jupyter-pytorch workbench image with Python py39 based on c9s for ODH or RHODS" \
io.k8s.display-name="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
authoritative-source-url="https://github.com/opendatahub-contrib/workbench-images" \
io.openshift.build.commit.ref="2024b" \
io.openshift.build.source-location="https://github.com/opendatahub-contrib/workbench-images" \
FROM registry.access.redhat.com/ubi8/python-39:1-176.1712880517
LABEL name="workbench-images:cuda-jupyter-pytorch-c9s-py39_2024b_20240418" \
summary="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
description="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
io.k8s.description="cuda-jupyter-pytorch workbench image with Python py39 based on c9s for ODH or RHODS" \
io.k8s.display-name="cuda-jupyter-pytorch workbench image with Python py39 based on c9s" \
authoritative-source-url="https://github.com/opendatahub-contrib/workbench-images" \
io.openshift.build.commit.ref="2024b" \
io.openshift.build.source-location="https://github.com/opendatahub-contrib/workbench-images" \
@pandeybk
pandeybk / gist:bedfbd0f2a09f24b2b21e22af207e34a
Created May 1, 2024 22:38
run-rhoai-workbenc-notebook-as-root.yaml
apiVersion: kubeflow.org/v1
kind: Notebook
metadata:
annotations:
notebooks.opendatahub.io/inject-oauth: 'true'
opendatahub.io/image-display-name: cuda-112-v6-sudo-access
notebooks.opendatahub.io/oauth-logout-url: >-
https://rhods-dashboard-redhat-ods-applications.apps.cloud9c.xtoph156.dfw.ocp.run/projects/demoproject?notebookLogout=sudo-access-v7
opendatahub.io/accelerator-name: ''
openshift.io/description: ''
@pandeybk
pandeybk / .json
Created April 23, 2024 23:23
dcgm-grafana-custom-dashboard.json
{
"annotations": {
"list": [
{
"$$hashKey": "object:192",
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
@pandeybk
pandeybk / .json
Last active April 23, 2024 19:52
dcgm-dashboard.json
{
"annotations": {
"list": [
{
"$$hashKey": "object:192",
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
@pandeybk
pandeybk / custom-storage-class.yaml
Created April 2, 2024 19:39
custom-storage class for Red Hat Openshift AI
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
openshift.io/description: ""
openshift.io/display-name: demo2
finalizers:
- kubernetes.io/pvc-protection
labels:
opendatahub.io/dashboard: "true"