Nikhil0987 commited on
Commit
e63918a
·
verified ·
1 Parent(s): d15a2a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -9,7 +9,7 @@ from langchain.document_loaders import PyPDFLoader
9
  import os
10
  import fitz
11
  from PIL import Image
12
- import socket
13
 
14
  # Global variables
15
  COUNT, N = 0, 0
@@ -122,15 +122,9 @@ if __name__ == "__main__":
122
  "text" # Define txt
123
  ],
124
  title="PDF-Powered Chatbot"
125
- )
126
 
127
- def find_free_port():
128
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
129
- s.bind(('', 0))
130
- return s.getsockname()[1]
131
 
132
- free_port = find_free_port()
133
- interface.launch(server_port=free_port)
134
 
135
 
136
 
 
9
  import os
10
  import fitz
11
  from PIL import Image
12
+
13
 
14
  # Global variables
15
  COUNT, N = 0, 0
 
122
  "text" # Define txt
123
  ],
124
  title="PDF-Powered Chatbot"
125
+ ).launch(server_port=free_port)
126
 
 
 
 
 
127
 
 
 
128
 
129
 
130