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 mistletoe | |
import re | |
import mistletoe.markdown_renderer | |
import warnings | |
from typing import Any, Callable, List, Sequence, TYPE_CHECKING | |
from mistletoe.span_token import ( | |
SpanToken, | |
RawText, | |
) |
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 enum | |
import deepspeed | |
import argparse | |
from torch import nn | |
from torch.utils.data import Dataset, DataLoader | |
from torch.multiprocessing import spawn | |
class BoolOps(enum.Enum): |
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 os | |
import torch | |
import torch.distributed as distributed | |
import torch.multiprocessing as multiprocessing | |
import torch.nn as nn | |
import torch.optim as optim | |
from torch.nn.parallel import DistributedDataParallel | |
def example(rank, world_size): |
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
from pathlib import Path | |
from diffusers import StableDiffusionXLPipeline | |
import torch | |
from safetensors.torch import save_file | |
# text_encoder.text_model.encoder.layers.0.self_attn.k_proj.lora_linear_layer.down.weight | |
# lora_te_text_model_encoder_layers_0_self_attn_k_proj.lora_down.weight | |
# 1. text_encoder -> lora_te, text_encoder_2 -> lora_te2 | |
# 2. map | |
# 3. .weight -> 2 .alpha -> 1 and replace . -> _ |
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
from collections import OrderedDict | |
import inspect | |
import typing | |
class SearchSpacesDict(OrderedDict): | |
def __setitem__(self, key, value): | |
super().__setitem__(key, value) | |
self.move_to_end(key) |
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
from collections import OrderedDict | |
import inspect | |
import typing | |
class SearchSpacesDict(OrderedDict): | |
def __setitem__(self, key, value): | |
super().__setitem__(key, value) | |
self.move_to_end(key) | |
class Tunable(): |
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
/** | |
* @file build配置 | |
* @author edpx-mobile | |
*/ | |
var cwd = process.cwd(); | |
var path = require('path'); | |
// 引入 rider 支持 | |
var epr = require('./edp-rider-config'); |