JohanBeytell commited on
Commit
e1185fa
·
verified ·
1 Parent(s): 99d05fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -26
app.py CHANGED
@@ -169,17 +169,11 @@ def flag_output(prompt, generated_text, next_words, temperature):
169
 
170
  return "Output flagged successfully."
171
 
172
- def push_flagged_to_dataset():
173
- import datasets
174
- dataset = datasets.load_dataset("InfinitodeLTD/DungenDev-FlaggedOutputs", split="train")
175
- dataset = dataset.add_item(flagged_outputs)
176
- dataset.push_to_hub()
177
- flagged_outputs.clear()
178
- return "Flagged outputs pushed to public dataset."
179
-
180
  def display_disclaimer():
181
- return ('Dungen Dev is an experimental model and may produce outputs that are inappropriate, biased, or potentially harmful and inaccurate. '
182
- 'Caution is advised.')
 
 
183
 
184
  demo = gr.Interface(
185
  fn=generate_text,
@@ -190,8 +184,8 @@ demo = gr.Interface(
190
  ],
191
  outputs=[
192
  gr.Textbox(label="Generated Names"),
 
193
  ],
194
- live=True,
195
  title='Dungen Dev - Name Generator',
196
  description=None,
197
  examples=[
@@ -203,20 +197,6 @@ demo = gr.Interface(
203
  ]
204
  )
205
 
206
- flag_ui = gr.Interface(
207
- fn=flag_output,
208
- inputs=[
209
- gr.Textbox(label="Prompt", interactive=False),
210
- gr.Textbox(label="Generated Names", interactive=False),
211
- gr.Number(label="Next Words", interactive=False),
212
- gr.Number(label="Temperature", interactive=False),
213
- ],
214
- outputs=[
215
- gr.Textbox(label="Flag Status")
216
- ],
217
- title="Flag Output"
218
- )
219
-
220
- disclaimer_ui = gr.HTML(display_disclaimer())
221
 
222
  demo.launch()
 
169
 
170
  return "Output flagged successfully."
171
 
 
 
 
 
 
 
 
 
172
  def display_disclaimer():
173
+ return ('<div style="padding:10px; border:1px solid #ccc; border-radius:5px; background-color:#f9f9f9;">
174
+ Dungen Dev is an experimental model and may produce outputs that are inappropriate, biased, or potentially harmful and inaccurate.
175
+ Caution is advised.
176
+ </div>')
177
 
178
  demo = gr.Interface(
179
  fn=generate_text,
 
184
  ],
185
  outputs=[
186
  gr.Textbox(label="Generated Names"),
187
+ gr.Button(value="Flag", elem_id="flag_button"),
188
  ],
 
189
  title='Dungen Dev - Name Generator',
190
  description=None,
191
  examples=[
 
197
  ]
198
  )
199
 
200
+ disclaimer = gr.HTML(display_disclaimer(), elem_id="disclaimer_div")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
  demo.launch()