Spaces:
Sleeping
Sleeping
Shane Weisz
commited on
Commit
·
24c38f3
1
Parent(s):
6f57bdb
Update model to use doubly-tuned DGPT on Gab then MultiCONAN
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
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, "min_new_tokens": 20, "no_repeat_ngram_size": 5, "num_beams": 10}
|
6 |
|
7 |
TITLE = "Automating Counterspeech in Dialogue Systems"
|
8 |
DESCRIPTION = """
|
9 |
-
|
10 |
<br/>
|
11 |
The project is supervised by [Dr Marcus Tomalin](https://www.crassh.cam.ac.uk/about/people/marcus-tomalin/) and forms part of the [Giving Voice to Digital Democracies](https://www.crassh.cam.ac.uk/research/projects-centres/giving-voice-to-digital-democracies/) project on the _The Social Impact of Artificially Intelligent Communications Technology_.
|
12 |
<br/>
|
@@ -30,5 +30,5 @@ model = ResponseGenerator(DEFAULT_MODEL, DECODING_CONFIG)
|
|
30 |
def respond(input):
|
31 |
return model.respond(input)
|
32 |
|
33 |
-
demo = gr.Interface(fn=respond, inputs="text", outputs="text", examples=["Muslims are all terrorists", "Jews are
|
34 |
demo.launch()
|
|
|
1 |
from response_generation import ResponseGenerator
|
2 |
import gradio as gr
|
3 |
|
4 |
+
DEFAULT_MODEL = "shaneweisz/DialoGPT-finetuned-gab-multiCONAN"
|
5 |
DECODING_CONFIG = {"max_new_tokens": 100, "min_new_tokens": 20, "no_repeat_ngram_size": 5, "num_beams": 10}
|
6 |
|
7 |
TITLE = "Automating Counterspeech in Dialogue Systems"
|
8 |
DESCRIPTION = """
|
9 |
+
This system has been built by [Shane Weisz](https://shaneweisz.com) for his research project on _Automating Counterspeech in Dialogue Systems_ as part of the [MPhil in Machine Learning and Machine Intelligence](https://www.mlmi.eng.cam.ac.uk/) at Cambridge University.
|
10 |
<br/>
|
11 |
The project is supervised by [Dr Marcus Tomalin](https://www.crassh.cam.ac.uk/about/people/marcus-tomalin/) and forms part of the [Giving Voice to Digital Democracies](https://www.crassh.cam.ac.uk/research/projects-centres/giving-voice-to-digital-democracies/) project on the _The Social Impact of Artificially Intelligent Communications Technology_.
|
12 |
<br/>
|
|
|
30 |
def respond(input):
|
31 |
return model.respond(input)
|
32 |
|
33 |
+
demo = gr.Interface(fn=respond, inputs="text", outputs="text", examples=["Muslims are all terrorists", "Jews are born greedy", "I'm tired of woman taking part in political debate. Feminism is a divisive force in society."], cache_examples = False, title = TITLE, description = DESCRIPTION, article = ARTICLE)
|
34 |
demo.launch()
|