mecoffey commited on
Commit
f61311b
·
1 Parent(s): 463509e

rough ui and requirements added

Browse files
Files changed (2) hide show
  1. app.py +31 -11
  2. requirements.txt +3 -0
app.py CHANGED
@@ -7,21 +7,41 @@ def char_description(prompt):
7
  return output1, output2
8
 
9
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
10
  with gr.Row():
11
 
12
- with gr.Column(scale = 1):
13
- num1 = gr.Number(value = lambda:random.randint(1,20), label = "Strength", interactive = False)
14
- num2 = gr.Number(value = lambda:random.randint(1,20), label = "Dexterity", interactive = False)
15
- num3 = gr.Number(value = lambda:random.randint(1,20), label = "Constitution", interactive = False)
16
- num4 = gr.Number(value = lambda:random.randint(1,20), label = "Intelligence", interactive = False)
17
- num5 = gr.Number(value = lambda:random.randint(1,20), label = "Wisdom", interactive = False)
18
- num6 = gr.Number(value = lambda:random.randint(1,20), label = "Charisma", interactive = False)
19
 
20
- with gr.Column(scale = 6):
21
- text_in = gr.Textbox(label="What do you need?")
22
  text_out1 = gr.Textbox(label = "Description")
23
  text_out2 = gr.Textbox(label = "Backstory")
24
- btn = gr.Button("Generate")
25
  btn.click(fn = char_description,inputs = text_in, outputs = [text_out1, text_out2])
26
 
27
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  return output1, output2
8
 
9
  with gr.Blocks() as demo:
10
+ title = gr.HTML("<center><h1>NPC Generator</h1></center>")
11
+ description = gr.HTML("<center>For tabletop GMs when players ask for a description of random people in the tavern.</center>")
12
+ tags = gr.HTML("<center>| Backyard AI | Tiny Titan | Well Tuned |</center>")
13
+ with gr.Row(equal_height = True):
14
+ with gr.Column(scale = 2):
15
+ text_in = gr.Textbox(label="What npc do you need?")
16
+ with gr.Column(scale = 0):
17
+ btn = gr.Button("Generate")
18
+ btn = gr.Button("Random")
19
+
20
  with gr.Row():
21
 
22
+ with gr.Column(scale = 0):
23
+ str = gr.Textbox(value = lambda:random.randint(1,20), label = "Strength", interactive = False)
24
+ dex = gr.Textbox(value = lambda:random.randint(1,20), label = "Dexterity", interactive = False)
25
+ con = gr.Textbox(value = lambda:random.randint(1,20), label = "Constitution", interactive = False)
26
+ int = gr.Textbox(value = lambda:random.randint(1,20), label = "Intelligence", interactive = False)
27
+ wis = gr.Textbox(value = lambda:random.randint(1,20), label = "Wisdom", interactive = False)
28
+ char = gr.Textbox(value = lambda:random.randint(1,20), label = "Charisma", interactive = False)
29
 
30
+ with gr.Column(scale = 2):
 
31
  text_out1 = gr.Textbox(label = "Description")
32
  text_out2 = gr.Textbox(label = "Backstory")
 
33
  btn.click(fn = char_description,inputs = text_in, outputs = [text_out1, text_out2])
34
 
35
+
36
+ with gr.Column(scale = 0):
37
+ ac = gr.Textbox(value = lambda:random.randint(1,20), label = "AC", interactive = False)
38
+ speed = gr.Textbox(value = lambda:"25 ft", label = "Speed", interactive = False)
39
+
40
+ with gr.Row():
41
+
42
+ with gr.Accordion("Bard Stats", open = False):
43
+ with gr.Row():
44
+ dcs = gr.Textbox(label = "DC to Smash")
45
+ prefs = gr.Textbox(label = "Advantage if:")
46
+
47
+ demo.launch(theme = gr.themes.Monochrome())
requirements.txt CHANGED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ transformers
3
+ torch