This file contains 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
# Must have conda installed | |
# It costs approximately $0.2 (in GPT-4 API fees) to generate one example with analysis and design, and around $2.0 for a full project. | |
conda create -n metagpt python=3.11.4 | |
conda activate metagpt | |
npm --version # to check you have npm installed | |
# optional: install node if you don't have it | |
npm install -g @mermaid-js/mermaid-cli | |
git clone https://github.com/geekan/metagpt | |
cd metagpt |
This file contains 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
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint. | |
# *Only* converts the UNet, VAE, and Text Encoder. | |
# Does not convert optimizer state or any other thing. | |
# Written by jachiam | |
import argparse | |
import os.path as osp | |
import torch |
This file contains 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
# syntax=docker/dockerfile:1 | |
# PyTorch3D supports up to PyTorch 1.11, 22.02 is the last image to use 1.11 before they | |
# upgrade to 1.12 | |
FROM nvcr.io/nvidia/pytorch:22.02-py3 | |
WORKDIR /app | |
ARG DEBIAN_FRONTEND=noninteractive | |
ENV TZ=Europe/Amsterdam | |
# Get the basic Linux packages upgraded and get the development tools setup |
This file contains 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
# TFLite quantized inference example | |
# | |
# Based on: | |
# https://www.tensorflow.org/lite/performance/post_training_integer_quant | |
# https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/Tensor.QuantizationParams | |
import numpy as np | |
import tensorflow as tf | |
# Location of tflite model file (float32 or int8 quantized) |
This file contains 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 functools | |
import numpy as np | |
import tensorflow.compat.v1 as tf | |
from tensorflow.python.tpu import tpu_function | |
BATCH_NORM_DECAY = 0.9 | |
BATCH_NORM_EPSILON = 1e-5 | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
_APP_ENV=production | |
_APP_LOCALE=en | |
_APP_OPTIONS_ABUSE=enabled | |
_APP_OPTIONS_FORCE_HTTPS=disabled | |
_APP_OPENSSL_KEY_V1=your-secret-key | |
_APP_DOMAIN=localhost | |
_APP_DOMAIN_TARGET=localhost | |
_APP_CONSOLE_WHITELIST_ROOT=enabled | |
_APP_CONSOLE_WHITELIST_EMAILS= | |
_APP_CONSOLE_WHITELIST_IPS= |
This file contains 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
fun getDeviceSerial(applicationContext: Context): String? { | |
var serialNumber: String? | |
try { | |
val c = Class.forName("android.os.SystemProperties") | |
val get = c.getMethod("get", String::class.java) | |
serialNumber = get.invoke(c, "gsm.sn1") as String |
This file contains 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
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353 | |
import os | |
import ffmpeg | |
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'): | |
""" | |
Compress video file to max-supported size. | |
:param video_full_path: the video you want to compress. | |
:param size_upper_bound: Max video size in KB. |
This file contains 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
#python | |
''' | |
setup instruction | |
for Install pythonosc | |
pip install python-osc | |
''' | |
from pythonosc import dispatcher |
NewerOlder