Skip to content

Instantly share code, notes, and snippets.

@jhabr
jhabr / build_torch_orin.sh
Last active March 29, 2024 09:39
Build PyTorch for Nvidia Jetson AGX Orin
#!/bin/bash
export USE_NCCL=0
export USE_DISTRIBUTED=1
export USE_QNNPACK=0
export USE_PYTORCH_QNNPACK=0
# Orin is based on Ampere Achitecture
export TORCH_CUDA_ARCH_LIST="8.7"
@jhabr
jhabr / TextClassifierAndroid.kt
Last active July 24, 2023 21:48
Huggingface Distilbert Conversion to TFLite using TF 2.x and Usage on Android
import android.content.Context
import org.tensorflow.lite.Interpreter
import timber.log.Timber
import java.io.FileInputStream
import java.nio.MappedByteBuffer
import java.nio.channels.FileChannel
import kotlin.system.measureTimeMillis
/*
make sure to include the following in the app/build.gradle dependencies: