Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,12 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
|
|
22 |
from langchain_community.llms import HuggingFaceHub
|
23 |
from langchain_core.documents import Document
|
24 |
from sentence_transformers import SentenceTransformer
|
25 |
-
import nest_asyncio
|
26 |
from llama_parse import LlamaParse
|
|
|
|
|
27 |
|
28 |
nest_asyncio.apply()
|
|
|
29 |
|
30 |
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
31 |
llama_cloud_api_key = os.environ.get("LLAMA_CLOUD_API_KEY")
|
@@ -468,6 +470,4 @@ with gr.Blocks() as demo:
|
|
468 |
clear_button.click(clear_cache, inputs=[], outputs=clear_output)
|
469 |
|
470 |
if __name__ == "__main__":
|
471 |
-
demo.launch()
|
472 |
-
|
473 |
-
|
|
|
22 |
from langchain_community.llms import HuggingFaceHub
|
23 |
from langchain_core.documents import Document
|
24 |
from sentence_transformers import SentenceTransformer
|
|
|
25 |
from llama_parse import LlamaParse
|
26 |
+
import asyncio
|
27 |
+
import nest_asyncio
|
28 |
|
29 |
nest_asyncio.apply()
|
30 |
+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # Use this on Windows
|
31 |
|
32 |
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
33 |
llama_cloud_api_key = os.environ.get("LLAMA_CLOUD_API_KEY")
|
|
|
470 |
clear_button.click(clear_cache, inputs=[], outputs=clear_output)
|
471 |
|
472 |
if __name__ == "__main__":
|
473 |
+
demo.launch(server_port=7861) # or any other available port
|
|
|
|