quoc-khanh commited on
Commit
3d50ef0
·
verified ·
1 Parent(s): 72ee423

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -13,7 +13,7 @@ from helpers import (
13
  )
14
 
15
  from file_loader import get_vectorstore
16
-
17
 
18
  if "GOOGLE_API_KEY" not in os.environ:
19
  os.environ["GOOGLE_API_KEY"] = "AIzaSyDJ4vIKuIBIPNHATLxnoHlagXWbsAz-vRs"
@@ -108,7 +108,10 @@ with gr.Blocks() as demo:
108
 
109
  if __name__ == "__main__":
110
  os.environ["USER_AGENT"] = "gradio-hf-space"
111
- # Tell Playwright to install browsers into the local folder (needed in some environments)
112
- # os.system("playwright install")
 
 
 
113
 
114
- demo.launch()
 
13
  )
14
 
15
  from file_loader import get_vectorstore
16
+ import asyncio
17
 
18
  if "GOOGLE_API_KEY" not in os.environ:
19
  os.environ["GOOGLE_API_KEY"] = "AIzaSyDJ4vIKuIBIPNHATLxnoHlagXWbsAz-vRs"
 
108
 
109
  if __name__ == "__main__":
110
  os.environ["USER_AGENT"] = "gradio-hf-space"
111
+
112
+ if not hasattr(demo, "stop_event") or demo.stop_event is None:
113
+ demo.stop_event = asyncio.Event()
114
+ demo.launch()
115
+
116
 
117
+ # demo.launch()