Spaces:
Sleeping
Sleeping
File size: 1,457 Bytes
e03acc1 b1cd096 e03acc1 97ca3cd e03acc1 97ca3cd e03acc1 8859aa1 75df636 fb735e8 e03acc1 485ecd0 4ac809a 5b3d2ef 4ac809a e03acc1 9d396c7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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) |