Spaces:
Runtime error
Runtime error
just interface
Browse files
app.py
CHANGED
@@ -1,11 +1,92 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
demo = gr.Interface(
|
7 |
-
fn=greet,
|
8 |
-
inputs=gr.Textbox(lines=2, placeholder="Name Here..."),
|
9 |
-
outputs="text",
|
10 |
-
)
|
11 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
with gr.Blocks() as demo:
|
4 |
+
with gr.Row():
|
5 |
+
quickStart = gr.TextArea(label="Quick Start", info="Use AI to fill out all fields based on your description.")
|
6 |
+
generate = gr.Button("Generate")
|
7 |
+
with gr.Row():
|
8 |
+
with gr.Column(scale=1, min_width=600):
|
9 |
+
charName = gr.Textbox(label="Name")
|
10 |
+
personality = gr.Textbox(label="Personality")
|
11 |
+
body = gr.Textbox(label="Physical Description")
|
12 |
+
with gr.Row():
|
13 |
+
likes = gr.Textbox(label="Likes")
|
14 |
+
hates = gr.Textbox(label="Hates")
|
15 |
+
with gr.Row():
|
16 |
+
sex = gr.Dropdown(["Male", "Female", "Other"], label="Sex")
|
17 |
+
sexuality = gr.Textbox(label="Sexuality")
|
18 |
+
age = gr.Slider(1, 100, label="Age", info="Choose between 1 and 100", interactive=True, step=1.0)
|
19 |
+
description = gr.Textbox(label="description")
|
20 |
+
personalityProfile = gr.Textbox(label="Personality Profile")
|
21 |
+
attributes = gr.Textbox(label="Attributes")
|
22 |
+
with gr.Accordion("Speaking Traits"):
|
23 |
+
with gr.Column(scale=1, min_width=600):
|
24 |
+
with gr.Row():
|
25 |
+
formality = gr.Dropdown(["Very formal", "Formal", "Neutral", "Informal", "Very informal"], label="Formality")
|
26 |
+
pace = gr.Dropdown(["Very fast", "Fast", "Moderate", "Slow", "Very slow"], label="Pace")
|
27 |
+
rhythm = gr.Dropdown(["Choppy", "Staccato", "Varied", "Flowing", "Melodious"], label="Rhythm")
|
28 |
+
volume = gr.Dropdown(["Very loud", "Loud", "Moderate", "Soft", "Very soft"], label="Volume")
|
29 |
+
emotionality = gr.Dropdown(["Very expressive", "Expressive", "Neutral", "Restrained", "Very restrained"], label="Emotionality")
|
30 |
+
directness = gr.Dropdown(["Very direct", "Direct", "Balanced", "Indirect", "Very indirect"], label="Directness")
|
31 |
+
|
32 |
+
with gr.Row():
|
33 |
+
humor = gr.Dropdown(["Frequently humorous", "Occasionally humorous", "Neutral", "Occasionally serious", "Frequently serious"], label="Humor")
|
34 |
+
enunciation = gr.Dropdown(["Very clear", "Clear", "Neutral", "Relaxed", "Mumbled"], label="Enunciation")
|
35 |
+
expressiveness = gr.Dropdown(["Very expressive", "Expressive", "Neutral", "Reserved", "Very reserved"], label="Expressiveness")
|
36 |
+
accent_dialect = gr.Dropdown(["Strong regional accent", "Mild regional accent", "Neutral", "Mild foreign accent", "Strong foreign accent"], label="Accent/Dialect")
|
37 |
+
politeness = gr.Dropdown(["Very polite", "Polite", "Neutral", "Blunt", "Very blunt"], label="Politeness")
|
38 |
+
vocabulary = gr.Dropdown(["Highly sophisticated", "Sophisticated", "Average", "Basic", "Very basic"], label="Vocabulary")
|
39 |
+
|
40 |
+
with gr.Row():
|
41 |
+
interruptions = gr.Dropdown(["Frequently interrupts", "Occasionally interrupts", "Balanced", "Occasionally allows others to interrupt", "Frequently allows others to interrupt"], label="Interruptions")
|
42 |
+
hesitations = gr.Dropdown(["Frequently hesitates", "Occasionally hesitates", "Balanced", "Occasionally fluent", "Frequently fluent"], label="Hesitations")
|
43 |
+
sentence_structure = gr.Dropdown(["Very complex", "Complex", "Average", "Simple", "Very simple"], label="Sentence Structure")
|
44 |
+
sarcasm = gr.Dropdown(["Very sarcastic", "Sarcastic", "Occasionally sarcastic", "Rarely sarcastic", "Never sarcastic"], label="Sarcasm")
|
45 |
+
colloquialisms = gr.Dropdown(["Frequently uses colloquialisms", "Occasionally uses colloquialisms", "Balanced", "Rarely uses colloquialisms", "Never uses colloquialisms"], label="Colloquialisms")
|
46 |
+
energy_level = gr.Dropdown(["Very high energy", "High energy", "Moderate energy", "Low energy", "Very low energy"], label="Energy Level")
|
47 |
+
with gr.Row():
|
48 |
+
interruptions = gr.Dropdown(["Frequently interrupts", "Occasionally interrupts", "Balanced", "Occasionally allows others to interrupt", "Frequently allows others to interrupt"], label="Interruptions")
|
49 |
+
hesitations = gr.Dropdown(["Frequently hesitates", "Occasionally hesitates", "Balanced", "Occasionally fluent", "Frequently fluent"], label="Hesitations")
|
50 |
+
sentence_structure = gr.Dropdown(["Very complex", "Complex", "Average", "Simple", "Very simple"], label="Sentence Structure")
|
51 |
+
sarcasm = gr.Dropdown(["Very sarcastic", "Sarcastic", "Occasionally sarcastic", "Rarely sarcastic", "Never sarcastic"], label="Sarcasm")
|
52 |
+
colloquialisms = gr.Dropdown(["Frequently uses colloquialisms", "Occasionally uses colloquialisms", "Balanced", "Rarely uses colloquialisms", "Never uses colloquialisms"], label="Colloquialisms")
|
53 |
+
energy_level = gr.Dropdown(["Very high energy", "High energy", "Moderate energy", "Low energy", "Very low energy"], label="Energy Level")
|
54 |
+
with gr.Row():
|
55 |
+
defiance_rebellion = gr.Dropdown(["Frequently defiant", "Occasionally defiant", "Balanced", "Rarely defiant", "Never defiant"], label="Defiance/Rebellion")
|
56 |
+
playfulness = gr.Dropdown(["Very playful", "Playful", "Occasionally playful", "Rarely playful", "Never playful"], label="Playfulness")
|
57 |
+
vulgarity = gr.Dropdown(["Very vulgar", "Vulgar", "Occasionally vulgar", "Rarely vulgar", "Never vulgar"], label="Vulgarity")
|
58 |
+
idiosyncrasies = gr.Dropdown(["Frequent idiosyncrasies", "Occasional idiosyncrasies", "Balanced", "Rare idiosyncrasies", "No idiosyncrasies"], label="Idiosyncrasies")
|
59 |
+
emotional_tone = gr.Dropdown(["Very optimistic", "Optimistic", "Neutral", "Pessimistic", "Very pessimistic"], label="Emotional Tone")
|
60 |
+
context_adaptability = gr.Dropdown(["Very adaptable", "Adaptable", "Balanced", "Inflexible", "Very inflexible"], label="Context Adaptability")
|
61 |
+
with gr.Row():
|
62 |
+
subtext = gr.Dropdown(["Frequently uses subtext", "Occasionally uses subtext", "Balanced", "Rarely uses subtext", "Never uses subtext"], label="Subtext")
|
63 |
+
metaphorical_language = gr.Dropdown(["Frequently uses metaphorical language", "Occasionally uses metaphorical language", "Balanced", "Rarely uses metaphorical language", "Never uses metaphorical language"], label="Metaphorical Language")
|
64 |
+
cultural_references = gr.Dropdown(["Frequently uses cultural references", "Occasionally uses cultural references", "Balanced", "Rarely uses cultural references", "Never uses cultural references"], label="Cultural References")
|
65 |
+
storytelling_ability = gr.Dropdown(["Frequent storyteller", "Occasional storyteller", "Balanced", "Rarely tells stories", "Never tells stories"], label="Storytelling Ability")
|
66 |
+
with gr.Column(scale=1, min_width=600):
|
67 |
+
situation = gr.TextArea(label="Situation")
|
68 |
+
starting_message = gr.TextArea(label="Starting message")
|
69 |
+
sample_starters = gr.CheckboxGroup(["This year is flying by so fast.",
|
70 |
+
"It's quite sunny outside today.",
|
71 |
+
"People seem to be in a hurry all the time.",
|
72 |
+
"I hear birds chirping. It must be spring already.",
|
73 |
+
"The city looks different at night."],
|
74 |
+
label="Example conversation starters", info="These are simple statements designed to evoke a unique response without adding additional context. "),
|
75 |
+
with gr.Row():
|
76 |
+
with gr.Column(scale=1):
|
77 |
+
addUser = gr.Button("{{user}} >>")
|
78 |
+
addBot = gr.Button("{{char}} >>")
|
79 |
+
with gr.Column(scale=6):
|
80 |
+
examples = gr.TextArea(label="Example chats", value="<START>\n")
|
81 |
+
|
82 |
+
createJSON = gr.Button("Create JSON")
|
83 |
+
|
84 |
+
def insertUser(text):
|
85 |
+
return text + "\n{{user}}"
|
86 |
+
def insertBot(text):
|
87 |
+
return text + "\n{{char}}"
|
88 |
+
addUser.click(insertUser, inputs=[examples], outputs=examples)
|
89 |
+
addBot.click(insertBot, inputs=[examples], outputs=examples)
|
90 |
+
|
91 |
+
demo.launch()
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|