Skip to content

Instantly share code, notes, and snippets.

import copy
import os
from dataclasses import dataclass
from typing import List, Union
import cv2
import numpy as np
from PIL import Image
import insightface
import glob
import logging
import os
import re
from os import PathLike
from pathlib import Path
from typing import Any, Dict, List, Union
import numpy as np
import torch
{
"meta": {
"generated_by": "sd_parseq",
"version": "0.1.105",
"generated_at": "Mon, 09 Oct 2023 07:52:05 GMT",
"doc_id": "doc-7a8f1e36-d527-4afd-af8d-79e4cd7f89ba",
"version_id": "version-64646a58-ae59-491f-9563-effa5bf90b4b"
},
"prompts": {
"format": "v2",
#@title 1.1 CivitAI.com - Tool download đầy đủ thông tin: Model file, config file, hình preview, file mô tả...
#@markdown [![Badge with Link](https://img.shields.io/badge/CivitAI.com-DOWNLOAD_MODEL_ALL-%2300A8E1?style=flat&logo=GITLAB&logoColor=84a805)](https://stablediffusion.edu.vn/)
from google.colab import drive
drive.mount('/content/gdrive')
# -*- coding: UTF-8 -*-
# handle msg between js and python side
import os
import time
import torch
import pytorch_lightning as pl
from datasets import load_dataset, load_metric
from transformers import T5Config, T5ForConditionalGeneration
from transformers import (
AutoModel,
AutoModelForSeq2SeqLM,
AutoTokenizer,
DataCollatorForSeq2Seq,
import pandas as pd
import pytorch_lightning as pl
from torch.utils.data import Dataset
import torch
class cnn_dailymail(Dataset):
def __init__(self, csv_file, tokenizer, max_length=512):
self.data = pd.read_csv(csv_file)
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 2 in line 2.
text sentiment
@VirginAmerica What @dhepburn said. neutral
@VirginAmerica it was amazing, and arrived an hour early. You're too good to me. positive
@VirginAmerica I <3 pretty graphics. so much better than minimal iconography. :D positive
@VirginAmerica So excited for my first cross country flight LAX to MCO I've heard nothing but great things about Virgin America. #29DaysToGo positive
I ❤️ flying @VirginAmerica. ☺️👍 positive
@VirginAmerica you know what would be amazingly awesome? BOS-FLL PLEASE!!!!!!! I want to fly with only you. positive
@VirginAmerica I love this graphic. http://t.co/UT5GrRwAaA positive
@VirginAmerica I love the hipster innovation. You are a feel good brand. positive
@VirginAmerica will you be making BOS>LAS non stop permanently anytime soon? neutral
root@83b2e028e1a8:/workspace# fuser -k 3000/tcp
cd /workspace/stable-diffusion-webui
python relauncher.py
Relauncher: Launching...
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
from transformers import AutoModelForCausalLM, AutoTokenizer, default_data_collator,DefaultDataCollator,DataCollatorWithPadding, get_linear_schedule_with_warmup
from peft import get_peft_config, get_peft_model, PromptTuningInit, PromptTuningConfig, TaskType, PeftType
import torch,os,random
from datasets import load_dataset
from torch.utils.data import DataLoader
from tqdm import tqdm
from evaluate import load as load_metric
from transformers import AdamW
model_name_or_path = "bigscience/bloomz-560m" #@param
This file has been truncated, but you can view the full file.