Rooni commited on
Commit
6daab6c
·
1 Parent(s): 79300dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -27,6 +27,9 @@ def generate_minecraft_command(minecraft_version, description=""):
27
  else:
28
  return f'Не удалось сгенерировать команду. {data}'
29
 
 
 
 
30
  iface = gr.Interface(
31
  fn=generate_minecraft_command,
32
  inputs=[
@@ -34,9 +37,17 @@ iface = gr.Interface(
34
  gr.Textbox(label="Описание команды")
35
  ],
36
  outputs=gr.Textbox(label="Команда"),
37
- live=True,
38
- live_button="Сгенерировать",
39
- button="Очистить",
40
- title="Minecraft Command Generator"
 
 
 
 
 
 
 
 
41
  )
42
  iface.launch()
 
27
  else:
28
  return f'Не удалось сгенерировать команду. {data}'
29
 
30
+ def clear_output():
31
+ return ""
32
+
33
  iface = gr.Interface(
34
  fn=generate_minecraft_command,
35
  inputs=[
 
37
  gr.Textbox(label="Описание команды")
38
  ],
39
  outputs=gr.Textbox(label="Команда"),
40
+ title="Minecraft Command Generator",
41
+ theme="compact",
42
+ layout="vertical",
43
+ examples=[
44
+ ["Minecraft Java 1.16", "Дай мне команду для создания структуры"]
45
+ ],
46
+ allow_flagging=False,
47
+ flagging_dir=None,
48
+ buttons=[
49
+ gr.Button(text="Сгенерировать", type="submit"),
50
+ gr.Button(text="Очистить", type="reset", onclick=clear_output)
51
+ ]
52
  )
53
  iface.launch()