Spaces:
Sleeping
Sleeping
from transformers import AutoModelForCausalLM, AutoTokenizer | |
import modin.pandas as pd | |
import gradio as gr | |
tokenizer = AutoTokenizer.from_pretrained("KoboldAI/OPT-2.7B-Nerybus-Mix") | |
model = AutoModelForCausalLM.from_pretrained("KoboldAI/OPT-2.7B-Nerybus-Mix") | |
def chat(Prompt): | |
input_ids = tokenizer(Prompt, return_tensors="pt").input_ids | |
generated_ids = model.generate(input_ids, max_length=256, repetition_penalty = 2.5, top_k = 75) | |
bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True) | |
return bot | |
title = 'Nerybus ChatBot' | |
description = 'This is an experimental model containing a parameter-wise 50/50 blend (weighted average) of the weights of NerysV2-2.7B and ErebusV1-2.7B Preliminary testing produces pretty coherent outputs, it appears to retain the NSFWness of Erebus but with a Nerys-esque twist in terms of prose. <b> Warning: THIS model is NOT suitable for use by minors. The model will output X-rated content.' | |
article = 'The two models used for this blend, NerysV2-2.7B and ErebusV1-2.7B are made by Mr. Seeker. <a href=\https://huggingface.co/KoboldAI/OPT-2.7B-Erebus</a> and <a href=\https://huggingface.co/KoboldAI/OPT-2.7B-Nerys-v2</a>' | |
https://huggingface.co/KoboldAI/OPT-2.7B-Erebus | |
https://huggingface.co/KoboldAI/OPT-2.7B-Nerys-v2' | |
gr.Interface(fn=chat, inputs='text', outputs='text', title=title, description=description, article=article).queue(max_size=10).launch(max_threads=40, debug=True) |