jam134 commited on
Commit
7cb2f3b
·
verified ·
1 Parent(s): 897eb38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,6 +1,9 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  from keep_alive import keep_alive
 
 
 
4
  """
5
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
@@ -62,5 +65,12 @@ def main():
62
  keep_alive(urls)
63
 
64
  if __name__ == "__main__":
65
- demo.launch()
66
- main()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  from keep_alive import keep_alive
4
+ import multiprocessing
5
+ import threading
6
+ import time
7
  """
8
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
9
  """
 
65
  keep_alive(urls)
66
 
67
  if __name__ == "__main__":
68
+ # 創建兩個進程
69
+ p1 = multiprocessing.Process(target=main)
70
+ p2 = multiprocessing.Process(target=respond)
71
+
72
+ p1.start()
73
+ p2.start()
74
+
75
+ p1.join()
76
+ p2.join()