Skip to content

Instantly share code, notes, and snippets.

View menandro's full-sized avatar

Menandro Roxas menandro

  • Research Scientist @ Rakuten Institute of Technology
  • Tokyo, Japan
View GitHub Profile
# Follow installation from here: https://www.reddit.com/r/LocalLLaMA/comments/11o6o3f/how_to_install_llama_8bit_and_4bit/
import torch
import torch.nn as nn
import sys
sys.path.append('repositories/GPTQ-for-LLaMa')
import time
from quant import make_quant
is_triton = False
import inspect
@menandro
menandro / CMakeLists.txt
Created September 15, 2020 01:51 — forked from erikzenker/CMakeLists.txt
CMake CUDA + C++ in separate files
# CMAKE FILE to separatly compile cuda and c++ files
# with the c++11 standard
#
#
# Folder structure:
#
# |
# +--main.cpp (with C++11 content)
# +--include/
# | |
function writeFlowFile(img, filename)
% writeFlowFile writes a 2-band image IMG into flow file FILENAME
% According to the c++ source code of Daniel Scharstein
% Contact: schar@middlebury.edu
% Author: Deqing Sun, Department of Computer Science, Brown University
% Contact: dqsun@cs.brown.edu
% $Date: 2007-10-31 15:36:40 (Wed, 31 Oct 2006) $
%% Generate vector field from fisheye stereo from faro
close all
clear all
% Change this file (calibFile)
calibFile = fopen('im203.xml');
calibrationFilename = 'calibrationField.flo';
translationFilename = 'trajectoryField.flo';
function img = readFlowFile(filename)
% readFlowFile read a flow file FILENAME into 2-band image IMG
% According to the c++ source code of Daniel Scharstein
% Contact: schar@middlebury.edu
% Author: Deqing Sun, Department of Computer Science, Brown University
% Contact: dqsun@cs.brown.edu
% $Date: 2007-10-31 16:45:40 (Wed, 31 Oct 2006) $
% Convert correspondence to depth (3d) - for equidistant model dataset
close all
clear all
% Change these two files (f and calibFile)
f = readFlowFile('im203.flo');
calibFile = fopen('im203.xml');
u = f(:,:,1);
v = f(:,:,2);
%% Generate vector field from fisheye stereo
close all
clear all
translationVectorFilename = 'translationVectorNewton.flo';
calibrationVectorFilename = 'calibrationVectorNewton.flo';
% Calibration data from T265
K0 = [285.722 0 420.135; 0 286.759 403.394; 0 0 1];
D0 = [-0.00659769 0.0473251 -0.0458264 0.00897725 0];
@menandro
menandro / SaveWorldAnchorGlobal.cs
Last active July 26, 2018 14:04
Saving world anchor (Holelens in Unity) for sharing among different apps.
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.XR.WSA;
using UnityEngine.XR.WSA.Sharing;
using System;
using System.Runtime.InteropServices.WindowsRuntime;
#if !UNITY_EDITOR