prep things

This commit is contained in:
Alex
2023-03-27 19:29:10 +01:00
parent 658b14ba26
commit d5522e7c08
4 changed files with 27 additions and 6 deletions

View File

@@ -335,7 +335,7 @@ def upload_file():
os.makedirs(save_dir)
file.save(os.path.join(save_dir, filename))
task = ingest.delay('temp', [".rst", ".md", ".pdf"], job_name, filename, user)
task = ingest.delay('temp', [".rst", ".md", ".pdf", ".txt"], job_name, filename, user)
# task id
task_id = task.id
return {"status": 'ok', "task_id": task_id}

View File

@@ -96,4 +96,4 @@ def ingest_worker(self, directory, formats, name_job, filename, user):
# delete local
shutil.rmtree(full_path)
return {'directory': directory, 'formats': formats, 'name_job': name_job, 'filename': filename, 'user': user}
return {'directory': directory, 'formats': formats, 'name_job': name_job, 'filename': filename, 'user': user, 'limited': False}

View File

@@ -13,8 +13,18 @@ interface Preference {
}
const initialState: Preference = {
apiKey: '',
selectedDocs: null,
apiKey: 'xxx',
selectedDocs: {
name: 'default',
language: 'default',
location: 'default',
version: 'default',
description: 'default',
fullName: 'default',
dat: 'default',
docLink: 'default',
model: 'openai_text-embedding-ada-002',
} as Doc,
sourceDocs: null,
};

View File

@@ -151,10 +151,18 @@ export default function Upload({
const { getRootProps, getInputProps, isDragActive } = useDropzone({
onDrop,
multiple: true,
multiple: false,
onDragEnter: doNothing,
onDragOver: doNothing,
onDragLeave: doNothing,
maxSize: 25000000,
accept: {
'application/pdf': ['.pdf'],
'text/plain': ['.txt'],
'text/x-rst': ['.rst'],
'text/x-markdown': ['.md'],
'application/zip': ['.zip'],
},
});
let view;
@@ -165,7 +173,10 @@ export default function Upload({
} else {
view = (
<>
<p className="mb-7 text-xl text-jet">Upload New Documentation</p>
<p className="text-xl text-jet">Upload New Documentation</p>
<p className="mb-3 text-xs text-gray-4000">
Please upload .pdf, .txt, .rst, .md, .zip limited to 25mb
</p>
<input
type="text"
className="h-10 w-[60%] rounded-md border-2 border-gray-5000 px-3 outline-none"