This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from azure.ai.ml import MLClient | |
from azure.ai.ml.entities import WorkspaceConnection | |
from azure.identity import DefaultAzureCredential | |
from azure.ai.ml.entities import UsernamePasswordConfiguration | |
# Enter details of your AML workspace | |
subscription_id = "" | |
resource_group = "" | |
workspace_name = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Different kinds of HF quantization summarized here | |
# https://github.com/huggingface/transformers/blob/main/docs/source/en/kv_cache.md | |
# replace lines 68-76 accordingly | |
from numpy import random | |
import argparse | |
import re | |
import json | |
import os | |
# import deepspeed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ort from 'onnxruntime-web'; | |
// use an async context to call onnxruntime functions. | |
async function main() { | |
ort.InferenceSession | |
const session = await ort.InferenceSession.create('./model4.onnx', { | |
executionProviders: ["wasm"], | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ort from 'onnxruntime-node'; | |
// use an async context to call onnxruntime functions. | |
async function main() { | |
ort.InferenceSession | |
const session = await ort.InferenceSession.create('./model4.onnx'); | |
// prepare feeds. use model input names as keys. | |
const feeds = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_batch(x, y, batch_size): | |
# print("x shape : {0}".format(x.shape)) | |
# print("y shape : {0}".format(y.shape)) | |
n_samples = x.shape[0] | |
indices = np.random.choice(n_samples, batch_size) | |
return x[indices], y[indices], indices | |
# clear old variables | |
tf.reset_default_graph() | |
X = tf.placeholder(tf.float32, [None, 32, 32, 3], name="Input") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Our application logic will be added here | |
def cnn_model_fn(features, labels, mode): | |
"""Model function for CNN.""" | |
# Input Layer | |
input_layer = tf.reshape(features["x"], [-1, 32, 32, 3], name="input_tensor") | |
# Convolutional Layer #1 | |
conv1 = tf.layers.conv2d( | |
inputs=input_layer, | |
filters=32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Jul 17 13:13:26 2017 | |
@author: agoswami | |
""" | |
class Car(object): | |
@staticmethod | |
def factory(type): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Pipes; | |
using System.Text; | |
class PipeServerBinary | |
{ | |
static void Main() | |
{ | |
using (NamedPipeServerStream pipe = new NamedPipeServerStream("testpipe")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jul 12 19:06:38 2017 | |
@author: agoswami | |
""" | |
#socket_echo_client_uds.py | |
import socket | |
import sys |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.