next-social commited on
Commit
3a2d51b
1 Parent(s): 6eaf242
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. requirements.txt +1 -2
  3. server.py +13 -19
Dockerfile CHANGED
@@ -17,4 +17,4 @@ COPY --chown=user . $HOME/app
17
 
18
  EXPOSE 7860
19
 
20
- CMD ["sh", "-c", "python3 server.py --notebook --mlock"]
 
17
 
18
  EXPOSE 7860
19
 
20
+ CMD ["sh", "-c", "python3 server.py --notebook --listen"]
requirements.txt CHANGED
@@ -2,8 +2,7 @@ accelerate==0.19.0
2
  colorama
3
  datasets
4
  flexgen==0.1.7
5
- gradio_client==0.2.5
6
- gradio==3.31.0
7
  markdown
8
  numpy
9
  pandas
 
2
  colorama
3
  datasets
4
  flexgen==0.1.7
5
+ gradio==3.32.0
 
6
  markdown
7
  numpy
8
  pandas
server.py CHANGED
@@ -786,13 +786,15 @@ def create_interface():
786
  # Extensions block
787
  extensions_module.create_extensions_block()
788
 
789
- print("start to Launch the interface")
790
  # Launch the interface
791
  shared.gradio['interface'].queue()
 
792
  if shared.args.listen:
793
- shared.gradio['interface'].launch(prevent_thread_lock=True, share=shared.args.share, server_name=shared.args.listen_host or '0.0.0.0', server_port=shared.args.listen_port, inbrowser=shared.args.auto_launch, auth=auth)
794
  else:
795
- shared.gradio['interface'].launch(prevent_thread_lock=True, share=shared.args.share, server_port=shared.args.listen_port, inbrowser=shared.args.auto_launch, auth=auth)
 
796
 
797
 
798
  if __name__ == "__main__":
@@ -873,20 +875,12 @@ if __name__ == "__main__":
873
  # add_lora_to_model(shared.args.lora)
874
 
875
  # Force a character to be loaded
876
- if shared.is_chat():
877
- shared.persistent_interface_state.update({
878
- 'mode': shared.settings['mode'],
879
- 'character_menu': shared.args.character or shared.settings['character'],
880
- 'instruction_template': shared.settings['instruction_template']
881
- })
882
-
883
- print("start create_interface")
884
  # Launch the web UI
885
- create_interface()
886
- while True:
887
- time.sleep(0.5)
888
- if shared.need_restart:
889
- shared.need_restart = False
890
- shared.gradio['interface'].close()
891
- time.sleep(0.5)
892
- create_interface()
 
786
  # Extensions block
787
  extensions_module.create_extensions_block()
788
 
789
+ logging.info('start to Launch the interface')
790
  # Launch the interface
791
  shared.gradio['interface'].queue()
792
+ logging.info('start to queue')
793
  if shared.args.listen:
794
+ shared.gradio['interface'].launch(share=shared.args.share, server_name=shared.args.listen_host or '0.0.0.0', server_port=shared.args.listen_port, inbrowser=shared.args.auto_launch, auth=auth)
795
  else:
796
+ shared.gradio['interface'].launch(share=shared.args.share, server_port=shared.args.listen_port, inbrowser=shared.args.auto_launch, auth=auth)
797
+ logging.info('end launch')
798
 
799
 
800
  if __name__ == "__main__":
 
875
  # add_lora_to_model(shared.args.lora)
876
 
877
  # Force a character to be loaded
878
+ # if shared.is_chat():
879
+ # shared.persistent_interface_state.update({
880
+ # 'mode': shared.settings['mode'],
881
+ # 'character_menu': shared.args.character or shared.settings['character'],
882
+ # 'instruction_template': shared.settings['instruction_template']
883
+ # })
884
+ logging.info('start create_interface')
 
885
  # Launch the web UI
886
+ create_interface()