tokeron commited on
Commit
6bd54bd
1 Parent(s): 680fd14

app updated

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -40,13 +40,15 @@ def get_prompt(prompt):
40
 
41
  return "Images generated"
42
 
 
43
  if __name__ == '__main__':
44
  with gr.Blocks() as demo:
45
  gallery = gr.Gallery(
46
  label="Generated images", show_label=False, elem_id="gallery",
47
  columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
48
  btn = gr.Button("Generate images", scale=0)
 
49
 
50
- btn.click(get_prompt, 'text', gallery)
51
 
52
- demo.launch()
 
40
 
41
  return "Images generated"
42
 
43
+
44
  if __name__ == '__main__':
45
  with gr.Blocks() as demo:
46
  gallery = gr.Gallery(
47
  label="Generated images", show_label=False, elem_id="gallery",
48
  columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
49
  btn = gr.Button("Generate images", scale=0)
50
+ text_input = gr.Interface(fn=get_prompt, inputs="text") # create a text input interface
51
 
52
+ btn.click(get_prompt, text_input, gallery) # pass the text input interface to btn.click()
53
 
54
+ demo.launch()
requirements.txt CHANGED
@@ -4,3 +4,4 @@ gradio
4
  torch
5
  torchvision
6
  torchtext
 
 
4
  torch
5
  torchvision
6
  torchtext
7
+ accelerate