Shane Weisz
Change wording in description
248c1be
raw
history blame
No virus
700 Bytes
from response_generation import ResponseGenerator
import gradio as gr
DEFAULT_MODEL = "shaneweisz/DialoGPT-finetuned-multiCONAN"
DECODING_CONFIG = {"max_new_tokens": 100, "no_repeat_ngram_size": 3, "num_beams": 10}
TITLE = "AutoCounterspeech"
DESCRIPTION = "Enter some hate speech, and see if the system generates an appropriate counterspeech response."
ARTICLE = f"""
**Model:** {DEFAULT_MODEL}<br>
**Decoding parameters:** {DECODING_CONFIG}
"""
model = ResponseGenerator(DEFAULT_MODEL, DECODING_CONFIG)
def respond(input):
return model.respond(input)
demo = gr.Interface(fn=respond, inputs="text", outputs="text", title = TITLE, description = DESCRIPTION, article = ARTICLE)
demo.launch()