custom slider added
Browse files- src/pdfchatbot.py +5 -5
src/pdfchatbot.py
CHANGED
@@ -16,7 +16,7 @@ from langchain_text_splitters import CharacterTextSplitter
|
|
16 |
|
17 |
|
18 |
class PDFChatBot:
|
19 |
-
def __init__(self, config_path="config.yaml"
|
20 |
"""
|
21 |
Initialize the PDFChatBot instance.
|
22 |
|
@@ -37,7 +37,7 @@ class PDFChatBot:
|
|
37 |
self.pipeline = None
|
38 |
self.chain = None
|
39 |
self.chunk_size = None
|
40 |
-
self.chunk_size_slider = chunk_size_slider
|
41 |
|
42 |
def load_config(self, file_path):
|
43 |
"""
|
@@ -71,7 +71,7 @@ class PDFChatBot:
|
|
71 |
if not text:
|
72 |
raise gr.Error('Enter text')
|
73 |
history.append((text, ''))
|
74 |
-
self.chunk_size_slider.interactive = False
|
75 |
return history
|
76 |
|
77 |
def create_prompt_template(self):
|
@@ -192,8 +192,8 @@ class PDFChatBot:
|
|
192 |
Returns:
|
193 |
PIL.Image.Image: The rendered page as an image.
|
194 |
"""
|
195 |
-
if self.chunk_size_slider.interactive == False:
|
196 |
-
|
197 |
print(chunk_size)
|
198 |
doc = fitz.open(file.name)
|
199 |
page = doc[self.page]
|
|
|
16 |
|
17 |
|
18 |
class PDFChatBot:
|
19 |
+
def __init__(self, config_path="config.yaml"):
|
20 |
"""
|
21 |
Initialize the PDFChatBot instance.
|
22 |
|
|
|
37 |
self.pipeline = None
|
38 |
self.chain = None
|
39 |
self.chunk_size = None
|
40 |
+
#self.chunk_size_slider = chunk_size_slider
|
41 |
|
42 |
def load_config(self, file_path):
|
43 |
"""
|
|
|
71 |
if not text:
|
72 |
raise gr.Error('Enter text')
|
73 |
history.append((text, ''))
|
74 |
+
#self.chunk_size_slider.interactive = False
|
75 |
return history
|
76 |
|
77 |
def create_prompt_template(self):
|
|
|
192 |
Returns:
|
193 |
PIL.Image.Image: The rendered page as an image.
|
194 |
"""
|
195 |
+
#if self.chunk_size_slider.interactive == False:
|
196 |
+
# self.chunk_size_slider.interactive = True
|
197 |
print(chunk_size)
|
198 |
doc = fitz.open(file.name)
|
199 |
page = doc[self.page]
|