amarax commited on
Commit
c4b383b
·
1 Parent(s): 1b0b3c9

Make it work with gradio hot-reloading, and reduce startup time by loading less models

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -133,13 +133,13 @@ class ConversationBot:
133
 
134
  bot = ConversationBot({'Text2Image': 'cuda:0',
135
  'ImageCaptioning': 'cuda:0',
136
- 'ImageEditing': 'cuda:0',
137
- 'VisualQuestionAnswering': 'cuda:0',
138
- 'Image2Canny': 'cpu',
139
- 'CannyText2Image': 'cuda:0',
140
  'InstructPix2Pix': 'cuda:0',
141
- 'Image2Depth': 'cpu',
142
- 'DepthText2Image': 'cuda:0',
143
  })
144
 
145
  with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:
@@ -203,4 +203,6 @@ with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:
203
  clear.click(lambda: [], None, chatbot)
204
  clear.click(lambda: [], None, state)
205
 
206
- demo.queue(concurrency_count=10).launch(server_name="0.0.0.0", server_port=7860)
 
 
 
133
 
134
  bot = ConversationBot({'Text2Image': 'cuda:0',
135
  'ImageCaptioning': 'cuda:0',
136
+ # 'ImageEditing': 'cuda:0',
137
+ # 'VisualQuestionAnswering': 'cuda:0',
138
+ # 'Image2Canny': 'cpu',
139
+ # 'CannyText2Image': 'cuda:0',
140
  'InstructPix2Pix': 'cuda:0',
141
+ # 'Image2Depth': 'cpu',
142
+ # 'DepthText2Image': 'cuda:0',
143
  })
144
 
145
  with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:
 
203
  clear.click(lambda: [], None, chatbot)
204
  clear.click(lambda: [], None, state)
205
 
206
+ # demo.queue(concurrency_count=10).launch(server_name="0.0.0.0", server_port=7860)
207
+ if __name__ == "__main__":
208
+ demo.launch()