Spaces:
Sleeping
Sleeping
rough ui and requirements added
Browse files- app.py +31 -11
- 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 =
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
with gr.Column(scale =
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|