nineteen
Browse files
app.py
CHANGED
@@ -87,8 +87,8 @@ def generate(image, pdfs, temperature=0.9, max_new_tokens=1500, top_p=0.95, repe
|
|
87 |
print(pdf.name) # /tmp/gradio/31ecc15809f1639fb96bebad2eac3dfe41eb5fce/After-Twenty-Years.pdf
|
88 |
documents.extend(loader.load())
|
89 |
# loader.load() will return a list of document objects, and then documents.extend() will add all these returned objects to documents = [].
|
|
|
90 |
|
91 |
-
|
92 |
# split the content into chunks
|
93 |
text_splitter = TokenTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
94 |
# TokenTextSplitter() can ensure the integrity of words
|
@@ -201,6 +201,7 @@ demo = gr.Interface(fn=generate,
|
|
201 |
gr.Image(sources=["upload", "webcam"], label="Upload Image", type="pil"),
|
202 |
|
203 |
gr.Files(file_count="multiple", file_types=["pdf"], interactive=True, label="Upload your PDFs"),
|
|
|
204 |
|
205 |
gr.Slider(
|
206 |
label="temperature",
|
|
|
87 |
print(pdf.name) # /tmp/gradio/31ecc15809f1639fb96bebad2eac3dfe41eb5fce/After-Twenty-Years.pdf
|
88 |
documents.extend(loader.load())
|
89 |
# loader.load() will return a list of document objects, and then documents.extend() will add all these returned objects to documents = [].
|
90 |
+
# so documents = [] will have all PDFs content
|
91 |
|
|
|
92 |
# split the content into chunks
|
93 |
text_splitter = TokenTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
94 |
# TokenTextSplitter() can ensure the integrity of words
|
|
|
201 |
gr.Image(sources=["upload", "webcam"], label="Upload Image", type="pil"),
|
202 |
|
203 |
gr.Files(file_count="multiple", file_types=["pdf"], interactive=True, label="Upload your PDFs"),
|
204 |
+
# select multiple files at once(control+a), instead of uploading files incremently!!!!!!!!!
|
205 |
|
206 |
gr.Slider(
|
207 |
label="temperature",
|