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
def load_cfg_from_json(json_file): | |
with open(json_file, "r", encoding="utf-8") as reader: | |
text = reader.read() | |
return json.loads(text) | |
def load_cfg(model_id, cfg_path): | |
hf_config = load_cfg_from_json(cfg_path) | |
if 'pretrained_cfg' not in hf_config: | |
# old form, pull pretrain_cfg out of the base dict | |
pretrained_cfg = hf_config |
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="/home/blackroot/Desktop/SD/sd-scripts/models/model.safetensors" # base checkpoint to finetune | |
image_dir="/home/blackroot/Desktop/SD/sd-scripts/train_data" # folder containing folders with repeats_conceptname | |
reg_dir="" #optional, just point this to an empty folder if you don't care | |
output="/home/blackroot/Desktop/SD/sd-scripts/outputs" # 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
def per_polygon_translate(generate_fn, input): | |
prompt = ( | |
f"""::JAPANESE TEXT:: | |
むし、 ある ところ に | |
[[0.0, 8.0], [252.0, 8.0], [252.0, 27.0], [0.0, 26.0]] | |
おじいさん と おばあさん が いました。 | |
[[0.0, 33.0], [289.0, 32.0], [289.0, 50.0], [0.0, 50.0]] | |
おじいさん が 山(やま) へ 木(き) を きり に いけば、 | |
[[0.0, 57.0], [416.0, 56.0], [417.0, 74.0], [0.0, 75.0]] | |
おばあさん は 川(かわ)へ せんたく に でかけます。 |
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 diffusers import StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline | |
from diffusers import EulerAncestralDiscreteScheduler | |
import torch | |
import torch.nn.functional | |
import gc | |
from PIL import Image | |
from mechanisms.tokenizer_utils import encode_from_pipe | |
@torch.no_grad() |
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 re, os, random, csv | |
class WildCLIP: | |
@classmethod | |
def INPUT_TYPES(s): | |
return { | |
"required": { | |
"text": ("STRING", {"multiline": True}), "clip": ("CLIP", ) | |
} | |
} |
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
// Fill out your copyright notice in the Description page of Project Settings. | |
#include "Ai/Behaviours/NecroAiBasicCombatant.h" | |
#include "NavigationSystem.h" | |
#include "NecroGameplayTags.h" | |
#include "AbilitySystem/NecroAbilitySystem.h" | |
#include "ActorInterfaces/CombatInterface.h" | |
#include "GameFramework/Character.h" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 json | |
def filter_images_by_score_interval(jsonl_file_path, target_interval, output_file_path): | |
min_score = None | |
matching_entries = [] | |
# Find the minimum score in the file | |
with open(jsonl_file_path, 'r') as file: | |
for line in file: | |
json_object = json.loads(line) |
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 |