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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>🌸 Voxel Pagoda Garden</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 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
| # Ref: https://huggingface.co/Qwen/Qwen-Image/discussions/7 | |
| from diffusers import DiffusionPipeline, PipelineQuantizationConfig | |
| from diffusers import BitsAndBytesConfig | |
| import torch | |
| quant_config = PipelineQuantizationConfig( | |
| quant_mapping={ | |
| "transformer": BitsAndBytesConfig( | |
| load_in_4bit=True, | |
| bnb_4bit_compute_dtype=torch.bfloat16, |
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 torch | |
| from transformers import AutoTokenizer,AutoModelForCausalLM | |
| import pandas | |
| model_name_or_path = "cyberagent/calm2-7b-chat" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name_or_path) | |
| model = AutoModelForCausalLM.from_pretrained(model_name_or_path, device_map="cpu", torch_dtype=torch.float32) | |
| # https://github.com/nlp-waseda/JMMLU/blob/main/JMMLU/college_computer_science.csv | |
| df=pandas.read_csv("college_computer_science.csv",header=None) |
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
| # Reference #1: https://note.com/npaka/n/nc55e44e407ff | |
| # Reference #2: https://huggingface.co/blog/gemma-peft | |
| # Licence: MIT | |
| from peft import LoraConfig | |
| lora_config = LoraConfig( | |
| r=8, | |
| target_modules=["q_proj", "o_proj", "k_proj", "v_proj", "gate_proj", "up_proj", "down_proj"], | |
| task_type="CAUSAL_LM", |
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
| # MIT | |
| from diffusers import StableDiffusionXLPipeline | |
| import torch | |
| pipe = StableDiffusionXLPipeline.from_single_file('/path/to/checkpoint.safetensors', torch_dtype=torch.float16) | |
| pipe.save_pretrained('/path/to/diffusers_version') |
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 DiffusionPipeline | |
| import torch | |
| from consistencydecoder import ConsistencyDecoder | |
| from PIL import Image | |
| import numpy as np | |
| pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7", torch_dtype=torch.float32) | |
| decoder_consistency = ConsistencyDecoder(device="cuda:0") # Model size: 2.49 GB |
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
| from datasets import load_dataset | |
| import requests | |
| from PIL import Image | |
| from tqdm import tqdm | |
| dataset = load_dataset("laion/dalle-3-dataset",split="train") | |
| for i,row in enumerate(tqdm(dataset)): | |
| with open(f"dalle3/{i:06}.txt","w") as f: |
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
| # MIT License | |
| from transformers import AutoTokenizer | |
| import transformers | |
| from langchain.document_loaders import PyPDFLoader | |
| import torch | |
| model = "NousResearch/Yarn-Llama-2-13b-128k" | |
| tokenizer = AutoTokenizer.from_pretrained(model) | |
| pipeline = transformers.pipeline( |
NewerOlder