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 copy | |
import os | |
from dataclasses import dataclass | |
from typing import List, Union | |
import cv2 | |
import numpy as np | |
from PIL import Image | |
import insightface |
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 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 |
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
{ | |
"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", |
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
#@title 1.1 CivitAI.com - Tool download đầy đủ thông tin: Model file, config file, hình preview, file mô tả... | |
#@markdown [](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 |
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 pytorch_lightning as pl | |
from datasets import load_dataset, load_metric | |
from transformers import T5Config, T5ForConditionalGeneration | |
from transformers import ( | |
AutoModel, | |
AutoModelForSeq2SeqLM, | |
AutoTokenizer, | |
DataCollatorForSeq2Seq, |
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 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.
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
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 |
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
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) | |
################################################################ |
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 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.
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
{"question":"How to use the sessionstate feature in Streamlit","document_title":"What is serializable session state?","document_link":"https://docs.streamlit.io/knowledge-base/using-streamlit/serializable-session-state#pickle.PicklingError","document_text":"## Serializable Session State\n\nSerialization refers to the process of converting an object or data structure into a format that can be persisted and shared, and allowing you to recover the data’s original structure. Python’s built-in [pickle](https://docs.python.org/3/library/pickle.html) module serializes Python objects to a byte stream (\"pickling\") and deserializes the stream into an object (\"unpickling\").\n\nBy default, Streamlit’s [Session State](https://docs.streamlit.io/library/advanced-features/session-state) allows you to persist any Python object for the duration of the session, irrespective of the object’s pickle-serializability. This property lets you store Python primitives such as integers, floating-point numbers, complex numbers and boo |
NewerOlder