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 langchain.llms.base import LLM | |
from langchain.callbacks.manager import CallbackManagerForLLMRun | |
from typing import Any, Dict, Generator, List, Optional | |
from pydantic import Field, root_validator | |
from model import ExLlama, ExLlamaCache, ExLlamaConfig | |
from tokenizer import ExLlamaTokenizer | |
from generator import ExLlamaGenerator | |
import os, glob, time, json, sys, logging | |
class Exllama(LLM): |
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 | |
import re | |
import string | |
import sys | |
def clean_text(text): | |
# Strip leading and trailing white space | |
text = text.strip() | |
# Replace consecutive white space characters with a single space |
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 cuda_ext | |
from model import ExLlama, ExLlamaCache | |
from lora import ExLlamaLora | |
import torch | |
import torch.nn.functional as F | |
from healing import * | |
class ExLlamaGenerator: | |
class Settings: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
import argparse | |
import os | |
import re | |
from transformers import AutoTokenizer | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
def l(tokenizer, txt): | |
return len(tokenizer.encode(txt)) |
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 pipe import StableDiffusionXLPipelineNoWatermark | |
from pipei2i import StableDiffusionXLImg2ImgPipelineNoWatermark | |
from diffusers import DiffusionPipeline | |
from PIL import Image | |
import os | |
import gc | |
import pandas as pd | |
import random, sys |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.