Spaces:
Paused
Paused
import gradio as gr | |
class Model: | |
def __init__(self, | |
name:str="Model", | |
placeholder:str="Input"): | |
self.name = name | |
self.placeholder = placeholder | |
self.SPETIAL_TOKENS = ["#νμ#", "#μ²μ#", "#(λ¨μ)μ²μ#", "#(λ¨μ)νμ#", "#(μ¬μ)μ²μ#", "(μ¬μ)νμ"] | |
def generate(self, inputs:str) -> str: | |
outputs = inputs | |
return outputs | |
def chat(self, message, chat_history): | |
response = self.generate(message) | |
for special_token in self.SPETIAL_TOKENS: | |
response = response.replace(special_token, 'λ') | |
chat_history.append((message, response)) | |
return "", gr.Chatbot(chat_history, label=self.name, bubble_full_width=False) |