Update app/main.py
Browse files- app/main.py +3 -3
app/main.py
CHANGED
@@ -19,10 +19,10 @@ logger = logging.getLogger(__name__)
|
|
19 |
class Chunker:
|
20 |
def __init__(self, strategy, split_seq=".", chunk_len=512):
|
21 |
self.split_seq = split_seq
|
22 |
-
self.chunk_len = int(chunk_len)
|
23 |
if strategy == "recursive":
|
24 |
self.split = RecursiveCharacterTextSplitter(
|
25 |
-
chunk_size=chunk_len,
|
26 |
separators=[split_seq]
|
27 |
).split_text
|
28 |
elif strategy == "sequence":
|
@@ -153,4 +153,4 @@ if __name__ == "__main__":
|
|
153 |
parser = argparse.ArgumentParser(description="A MAGIC example by ConceptaTech")
|
154 |
parser.add_argument("--port", type=int, default=7860, help="Port to expose Gradio app")
|
155 |
args = parser.parse_args()
|
156 |
-
main(args)
|
|
|
19 |
class Chunker:
|
20 |
def __init__(self, strategy, split_seq=".", chunk_len=512):
|
21 |
self.split_seq = split_seq
|
22 |
+
self.chunk_len = int(chunk_len) # Ensure chunk_len is an integer
|
23 |
if strategy == "recursive":
|
24 |
self.split = RecursiveCharacterTextSplitter(
|
25 |
+
chunk_size=self.chunk_len, # Use the integer chunk_len
|
26 |
separators=[split_seq]
|
27 |
).split_text
|
28 |
elif strategy == "sequence":
|
|
|
153 |
parser = argparse.ArgumentParser(description="A MAGIC example by ConceptaTech")
|
154 |
parser.add_argument("--port", type=int, default=7860, help="Port to expose Gradio app")
|
155 |
args = parser.parse_args()
|
156 |
+
main(args)
|