langchain-chat-with-milvus/document_ai/run.py

21 lines
413 B
Python
Raw Normal View History

2023-11-15 13:12:06 +00:00
from threading import Thread
2023-11-18 15:08:22 +00:00
import vector
2023-11-15 13:12:06 +00:00
import server
if __name__ == '__main__':
# Start the worker thread
2023-11-18 15:08:22 +00:00
worker_thread = Thread(target=vector.sync_documents, args=())
2023-11-15 13:12:06 +00:00
worker_thread.start()
# Start the server thread
server_thread = Thread(target=server.serve, args=())
server_thread.start()
# Wait for the threads to finish
worker_thread.join()
server_thread.join()