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
from transformers import AutoModelForCausalLM, CodeGenTokenizerFast as Tokenizer | |
from moondream import Moondream | |
from PIL import Image | |
from collections import Counter | |
import glob | |
import os | |
model = Moondream.from_pretrained("/home/blackroot/Desktop/moond/moondream1").to("cuda") | |
tokenizer = Tokenizer.from_pretrained("/home/blackroot/Desktop/moond/moondream1/tokenizer") |
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
#!/bin/bash | |
# Config Start | |
# Configurations | |
ckpt="checkpoint path here" # base checkpoint to finetune | |
image_dir="training path here, should have images as subfolder" # folder containing folders with repeats_conceptname | |
reg_dir="" #optional, just point this to an empty folder if you don't care | |
output="output path here" # safetensors output folder |
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 sympy as sp | |
import random | |
from functools import partial | |
# Define the symbol | |
x = sp.symbols('x') | |
# Rules dictionary mapping rule names to (operation, inverse operation) tuples | |
rules = { | |
'addition': (lambda f, n: f + n, lambda f, n: f - n), |
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
from PIL import Image | |
import os | |
import numpy as np | |
import sys | |
import cv2 | |
def video_to_frames(video_file, output_dir, one_every_n_frames): | |
# Create VideoCapture object | |
vidcap = cv2.VideoCapture(video_file) | |
fps = int(vidcap.get(cv2.CAP_PROP_FPS)) |
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 UnrealBuildTool; | |
public class Necromonicon : ModuleRules | |
{ | |
public Necromonicon(ReadOnlyTargetRules Target) : base(Target) | |
{ | |
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; | |
CppStandard = CppStandardVersion.Latest; | |
CStandard = CStandardVersion.Latest; |
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
NecroAiTask UNecroAiComponent::MoveToPoint(const FVector Dest, const float AcceptanceRadius = 160.0f) const | |
{ | |
auto NavSys = Cast<UNavigationSystemV1>(GetWorld()->GetNavigationSystem()); | |
check(NavSys); | |
auto NavProps = FNavAgentProperties(ControlledCharacter->GetSimpleCollisionRadius(), 128.f); | |
NavProps.bCanWalk = true; | |
NavProps.bCanFly = false; | |
auto Query = FPathFindingQuery(); | |
Query.NavAgentProperties = NavProps; |
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
#include <coroutine> | |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
#include <list> | |
#include <deque> | |
#include <functional> | |
struct Task { | |
struct promise_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
#include <coroutine> | |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
#include <list> | |
struct Task { | |
struct promise_type; | |
using TaskHandle = std::coroutine_handle<promise_type>; | |
struct promise_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
#pragma once | |
#include <coroutine> | |
#include <utility> | |
struct CoroTask | |
{ | |
struct promise_type; | |
using HandleType = std::coroutine_handle<promise_type>; | |
struct promise_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
import math | |
import os | |
from glob import glob | |
from pathlib import Path | |
from typing import Optional | |
import cv2 | |
import numpy as np | |
import torch | |
from einops import rearrange, repeat |