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
local ffi = require("ffi") | |
ffi.cdef("typedef struct { int *a; } foo_t;") | |
local function force_gc() | |
-- silly way to force collection | |
for i = 1, 10000 do | |
collectgarbage() | |
end | |
end |
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 torch | |
import sys | |
all_lora_keys = [ | |
"lora_te_text_model_encoder_layers_0_self_attn_k_proj.lora_down.weight", | |
"lora_te_text_model_encoder_layers_0_self_attn_k_proj.lora_up.weight", | |
"lora_te_text_model_encoder_layers_0_self_attn_k_proj.alpha", | |
"lora_te_text_model_encoder_layers_0_self_attn_v_proj.lora_down.weight", | |
"lora_te_text_model_encoder_layers_0_self_attn_v_proj.lora_up.weight", |
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 torch | |
import contextlib | |
import os | |
import math | |
import comfy.utils | |
import comfy.model_management | |
from comfy.clip_vision import clip_preprocess | |
from comfy.ldm.modules.attention import optimized_attention | |
import folder_paths |
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
start | end | text | |
---|---|---|---|
0.0 | 9.0 | Three men who previously served in the military are set to speak publicly about what they saw in this guy and heard behind closed doors. | |
9.0 | 10.0 | All right, what more? | |
10.0 | 11.0 | Guy and the light team. | |
11.0 | 15.0 | They have let in. Fifteen people from the public. | |
15.0 | 24.0 | There was David Grash, who's a former intelligence official, he has knowledge of a covert government program to recover crashed alien spacecraft. | |
25.0 | 32.0 | You saw me sweared or affirm that the testimony you are about to give is the truth, though all truth and nothing but the truth. So help you guys. | |
32.0 | 39.0 | That is David Grash, a former Afghanistan combat veteran in 14 year high ranking intelligence office. | |
39.0 | 40.0 | Hey, how are you? | |
40.0 | 41.0 | I'm a businessman. |
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 gradio as gr | |
import torch | |
import numpy as np | |
from PIL import Image | |
# Define function to generate a red image | |
def generate_red_image(size: int=256): | |
# Create a tensor with random values between 0 and 1 for each color channel | |
image_tensor = torch.rand(3, size, size).to("cuda") |
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
-- For the string library I used https://github.com/pygy/strung.lua and removed the need for ffi. | |
-- My modification is not optimal at all as it's made with ffi in mind, but at least it passed its test suite and might be useful for stress testing. | |
-- For bit operators I used https://github.com/davidm/lua-bit-numberlua/blob/master/lmod/bit/numberlua.lua | |
-- for require I used https://github.com/hoelzro/lua-procure | |
local function find_nyi_functions() | |
local blacklist = { | |
loadfile = true, | |
dofile = true, |
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 React, { | |
memo, | |
MutableRefObject, | |
PureComponent, | |
RefObject, | |
useCallback, | |
useEffect, | |
useMemo, | |
useRef, | |
useState, |
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
type Mode = "safe" | "faster"; | |
const modeStack: Mode[] = ["safe"]; | |
const getMode = () => modeStack[0]; | |
const pushMode = (mode: Mode) => modeStack.unshift(mode); | |
const popMode = () => modeStack.shift(); | |
type HasLength = { length: number }; | |
type WithModeRequest<Result> = { | |
mode: Mode; |
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
local preprocess = {} | |
function preprocess.Init() | |
if _G.load then | |
_G.old_preprocess_load = _G.old_preprocess_load or _G.load | |
local old_preprocess_load = _G.old_preprocess_load | |
_G.load = function(code, name, ...) | |
if type(code) == "string" then | |
code = preprocess.Preprocess(code, name, nil, "load") |
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
git clone git@github.com:LuaJIT/LuaJIT.git | |
cd LuaJIT | |
make | |
cd .. | |
gcc -O2 main.c -I LuaJIT/src/ -L LuaJIT/src/ -lluajit | |
./a.out main.lua |
NewerOlder