Spaces:
Sleeping
Sleeping
Shane Weisz
commited on
Commit
·
82488ed
1
Parent(s):
f648ebc
Add title, description and article
Browse files
app.py
CHANGED
@@ -1,17 +1,20 @@
|
|
1 |
from response_generation import ResponseGenerator
|
2 |
import gradio as gr
|
3 |
|
4 |
-
|
5 |
DEFAULT_MODEL = "shaneweisz/DialoGPT-finetuned-multiCONAN"
|
6 |
DECODING_CONFIG = {"max_new_tokens": 100, "no_repeat_ngram_size": 3, "num_beams": 10}
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
13 |
|
|
|
14 |
|
15 |
-
|
|
|
16 |
|
|
|
17 |
demo.launch()
|
|
|
1 |
from response_generation import ResponseGenerator
|
2 |
import gradio as gr
|
3 |
|
|
|
4 |
DEFAULT_MODEL = "shaneweisz/DialoGPT-finetuned-multiCONAN"
|
5 |
DECODING_CONFIG = {"max_new_tokens": 100, "no_repeat_ngram_size": 3, "num_beams": 10}
|
6 |
|
7 |
+
TITLE = "AutoCounterspeech"
|
8 |
+
DESCRIPTION = "Enter some hate speech and see whether the system responds with appropriate counterspeech."
|
9 |
+
ARTICLE = f"""
|
10 |
+
**Model:** {DEFAULT_MODEL}<br>
|
11 |
+
**Decoding parameters:** {DECODING_CONFIG}
|
12 |
+
"""
|
13 |
|
14 |
+
model = ResponseGenerator(DEFAULT_MODEL, DECODING_CONFIG)
|
15 |
|
16 |
+
def respond(input):
|
17 |
+
return model.respond(input)
|
18 |
|
19 |
+
demo = gr.Interface(fn=respond, inputs="text", outputs="text", title = TITLE, description = DESCRIPTION, article = ARTICLE)
|
20 |
demo.launch()
|