januarevan commited on
Commit
b0477e7
1 Parent(s): 6ed8bd2
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from fastapi import FastAPI, Form, Depends, Request, File, UploadFile
2
  from fastapi.encoders import jsonable_encoder
3
  from fastapi.responses import JSONResponse
@@ -80,7 +81,7 @@ async def insert(file: UploadFile = File(...)):
80
  if not milvus_client.has_collection(collection_name):
81
  create_a_collection(milvus_client, collection_name)
82
 
83
- contents = pypdf.PdfReader(contents)
84
 
85
  splitted_document_data = split_documents(contents)
86
 
 
1
+ from io import BytesIO
2
  from fastapi import FastAPI, Form, Depends, Request, File, UploadFile
3
  from fastapi.encoders import jsonable_encoder
4
  from fastapi.responses import JSONResponse
 
81
  if not milvus_client.has_collection(collection_name):
82
  create_a_collection(milvus_client, collection_name)
83
 
84
+ contents = pypdf.PdfReader(BytesIO(contents))
85
 
86
  splitted_document_data = split_documents(contents)
87