File size: 997 Bytes
e03acc1
b1cd096
e03acc1
 
97ca3cd
e03acc1
97ca3cd
e03acc1
 
8859aa1
75df636
fb735e8
e03acc1
 
485ecd0
 
 
e03acc1
67228ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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'
article = '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.'

gr.Interface(fn=chat, inputs='text', outputs='text', title=title, article=article).queue(max_size=10).launch(max_threads=40, debug=True)