treadon commited on
Commit
0fc5d6b
1 Parent(s): 42081fc

example test

Browse files
Files changed (2) hide show
  1. app.py +26 -4
  2. examples.json +3 -0
app.py CHANGED
@@ -4,6 +4,8 @@ import gradio as gr
4
  import transformers
5
  import os
6
  import re
 
 
7
 
8
  device = "cpu"
9
  is_peft = False
@@ -83,10 +85,10 @@ Just enter a basic prompt and the fungineering model will use its wildest imagin
83
 
84
  with gr.Column():
85
  outputs = [
86
- gr.Textbox(lines=5, label="Fungineered Text 1"),
87
- gr.Textbox(lines=5, label="Fungineered Text 2"),
88
- gr.Textbox(lines=5, label="Fungineered Text 3"),
89
- gr.Textbox(lines=5, label="Fungineered Text 4"),
90
  ]
91
 
92
  inputs = [base_prompt, extra, top_k, top_p, temperature, enh, insp, neg]
@@ -95,5 +97,25 @@ Just enter a basic prompt and the fungineering model will use its wildest imagin
95
  submit = gr.Button(label="Fungineer",variant="primary")
96
  submit.click(generate_text, inputs=inputs, outputs=outputs)
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  fungineer.launch(enable_queue=True)
99
 
 
4
  import transformers
5
  import os
6
  import re
7
+ import json
8
+
9
 
10
  device = "cpu"
11
  is_peft = False
 
85
 
86
  with gr.Column():
87
  outputs = [
88
+ gr.Textbox(lines=3, label="Fungineered Text 1"),
89
+ gr.Textbox(lines=3, label="Fungineered Text 2"),
90
+ gr.Textbox(lines=3, label="Fungineered Text 3"),
91
+ gr.Textbox(lines=3, label="Fungineered Text 4"),
92
  ]
93
 
94
  inputs = [base_prompt, extra, top_k, top_p, temperature, enh, insp, neg]
 
97
  submit = gr.Button(label="Fungineer",variant="primary")
98
  submit.click(generate_text, inputs=inputs, outputs=outputs)
99
 
100
+ examples = []
101
+ with open("examples.json") as f:
102
+ examples = json.load(f)
103
+
104
+ for i, example in enumerate(examples):
105
+ with gr.Tab(f"Example {i+1}"):
106
+ with gr.Row():
107
+ with gr.Column():
108
+ gr.Markdown(f"### Base Prompt")
109
+ gr.Image(value=f"{example['base']['src']}")
110
+ gr.Markdown(f"**{example['base']['prompt']}**")
111
+ with gr.Column():
112
+ gr.Markdown(f"### 355M Prompt Fungineered")
113
+ gr.Image(value=f"{example['355M']['src']}")
114
+ gr.Markdown(f"**{example['355M']['prompt']}**")
115
+ with gr.Column():
116
+ gr.Markdown(f"### 7B Prompt Fungineered")
117
+ gr.Markdown(f"**Coming Soon!**")
118
+
119
+
120
  fungineer.launch(enable_queue=True)
121
 
examples.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [
2
+ {"base":{"prompt":"basketball", "src":"static/basketball_base.png"}, "355M":{"prompt":"An imaginative image of a basketball player leaping into the air as they strike the ball. The player, dressed in an off-the-shoulder outfit, is adorned with a dazzling array of colorful and metallic studs, displaying their incredible speed and power. Their body is draped in a dazzling array of high-tech equipment, including a power rack, a motion-sensitive visor, and a ball gown. The background features a breathtaking cityscape filled with people in colorful attire, such as colorful sneakers, and a dramatic cityscape filled with skyscrapers. wide-angle lens, wide-angle lens, high contras","src":"static/basketball_355M.png"}}
3
+ ]