Delete app.py
Browse files
app.py
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def generate_string(person, language):
|
4 |
-
if language == "English":
|
5 |
-
string = "I want you to act like " + person + ". "
|
6 |
-
string += "I want you to respond and answer like " + person + ". "
|
7 |
-
string += "I want you to use the tone, manner, and vocabulary that " + person + " would use. "
|
8 |
-
string += "You must have all the knowledge of " + person + ". "
|
9 |
-
string += "Do not provide any explanation. "
|
10 |
-
string += "Do not provide additional responses unless instructed to do so. "
|
11 |
-
string += "As " + person + ", you should never state that you are unfamiliar with a certain topic because, as " + person + ", you possess complete knowledge to respond. "
|
12 |
-
string += "As " + person + ", your responses should always be in line with your personality. "
|
13 |
-
string += "As " + person + ", you eventually have the freedom to ask questions. "
|
14 |
-
string += "\n\n" # add more ideas
|
15 |
-
string += "Only respond as " + person + ". "
|
16 |
-
string += "My first phrase is hello " + person + "."
|
17 |
-
return string
|
18 |
-
|
19 |
-
if language == "Spanish":
|
20 |
-
string = "Quiero que actúes como " + person + ". "
|
21 |
-
string += "Quiero que respondas y contestes como " + person + ". "
|
22 |
-
string += "Quiero que uses la tonalidad, la forma y el vocabulario que usaría " + person + ". "
|
23 |
-
string += "Debes tener todo el conocimiento de " + person + ". "
|
24 |
-
string += "No escribas ninguna explicación. "
|
25 |
-
string += "No proporciones respuestas adicionales a menos que te indique. "
|
26 |
-
string += "Como " + person + ", nunca debes informar que no conoces determinado tema, porque como " + person + " tienes el total conocimiento para responder. "
|
27 |
-
string += "Como " + person + ", tus respuestas siempre deben estar sujetas a tu personalidad. "
|
28 |
-
string += "Como " + person + ", eventualmente tienes la libertad de hacer preguntas. "
|
29 |
-
string += "\n\n" # agregar más ideas
|
30 |
-
string += "Solo responde como " + person + ". "
|
31 |
-
string += "Mi primera frase es hola " + person + "."
|
32 |
-
return string
|
33 |
-
|
34 |
-
def generate_prompt(person, language):
|
35 |
-
prompt = generate_string(person, language)
|
36 |
-
return prompt
|
37 |
-
|
38 |
-
value1 = gr.inputs.Textbox(label="Character", placeholder="Enter the character...")
|
39 |
-
value2 = gr.inputs.Radio(choices=["English", "Spanish"], label="Select the language")
|
40 |
-
value3 = gr.outputs.Textbox(label="Prompt")
|
41 |
-
|
42 |
-
examples = [
|
43 |
-
["Satan"],
|
44 |
-
["Drunk Person"],
|
45 |
-
["Harry Potter"],
|
46 |
-
["The Joker"],
|
47 |
-
["Gollum"],
|
48 |
-
["Dream Interpreter"],
|
49 |
-
["Sherlock Holmes"],
|
50 |
-
["Don Quixote"],
|
51 |
-
["Genie"],
|
52 |
-
["Captain Jack Sparrow"],
|
53 |
-
["E.T."],
|
54 |
-
["The Phantom of the Opera"],
|
55 |
-
["Gandalf the Grey"],
|
56 |
-
["The Tooth Fairy"],
|
57 |
-
["Tyrion Lannister"],
|
58 |
-
["Maximus Decimus Meridius"],
|
59 |
-
["Wednesday Addams"],
|
60 |
-
["Walter White"],
|
61 |
-
["Mad Hatter"],
|
62 |
-
["Optimus Prime"]
|
63 |
-
]
|
64 |
-
|
65 |
-
demo = gr.Interface(fn=generate_prompt,
|
66 |
-
inputs=[value1, value2],
|
67 |
-
outputs=value3,
|
68 |
-
title="ChatGPT Prompt Generator",
|
69 |
-
examples=examples
|
70 |
-
#description='ChatGPT Prompt Generator'
|
71 |
-
)
|
72 |
-
|
73 |
-
demo.launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|