Merge pull request #897 from ParisNeo/main
Added more file types support to the webui
This commit is contained in:
@@ -57,10 +57,9 @@ ALTER USER your_new_role WITH PASSWORD 'your_secure_password';
|
||||
\q
|
||||
```
|
||||
|
||||
### 3. Install PGVector Extension
|
||||
|
||||
Install necessary dependencies and compile the extension:
|
||||
### 3. Install PGVector and Age Extensions
|
||||
|
||||
Install PGVector:
|
||||
```bash
|
||||
sudo apt install postgresql-server-dev-all
|
||||
cd /tmp
|
||||
@@ -69,6 +68,15 @@ cd pgvector
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
Install age:
|
||||
```bash
|
||||
sudo apt-get install build-essential libpq-dev
|
||||
cd /tmp
|
||||
git clone https://github.com/apache/age.git
|
||||
cd age
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### 4. Create a Database for LightRAG
|
||||
|
||||
|
@@ -579,6 +579,37 @@ class DocumentManager:
|
||||
".docx",
|
||||
".pptx",
|
||||
".xlsx",
|
||||
".rtf", # Rich Text Format
|
||||
".odt", # OpenDocument Text
|
||||
".tex", # LaTeX
|
||||
".epub", # Electronic Publication
|
||||
".html", # HyperText Markup Language
|
||||
".htm", # HyperText Markup Language
|
||||
".csv", # Comma-Separated Values
|
||||
".json", # JavaScript Object Notation
|
||||
".xml", # eXtensible Markup Language
|
||||
".yaml", # YAML Ain't Markup Language
|
||||
".yml", # YAML
|
||||
".log", # Log files
|
||||
".conf", # Configuration files
|
||||
".ini", # Initialization files
|
||||
".properties", # Java properties files
|
||||
".sql", # SQL scripts
|
||||
".bat", # Batch files
|
||||
".sh", # Shell scripts
|
||||
".c", # C source code
|
||||
".cpp", # C++ source code
|
||||
".py", # Python source code
|
||||
".java", # Java source code
|
||||
".js", # JavaScript source code
|
||||
".ts", # TypeScript source code
|
||||
".swift", # Swift source code
|
||||
".go", # Go source code
|
||||
".rb", # Ruby source code
|
||||
".php", # PHP source code
|
||||
".css", # Cascading Style Sheets
|
||||
".scss", # Sassy CSS
|
||||
".less", # LESS CSS
|
||||
),
|
||||
):
|
||||
self.input_dir = Path(input_dir)
|
||||
@@ -1148,8 +1179,43 @@ def create_app(args):
|
||||
|
||||
# Process based on file type
|
||||
match ext:
|
||||
case ".txt" | ".md":
|
||||
case (
|
||||
".txt"
|
||||
| ".md"
|
||||
| ".html"
|
||||
| ".htm"
|
||||
| ".tex"
|
||||
| ".json"
|
||||
| ".xml"
|
||||
| ".yaml"
|
||||
| ".yml"
|
||||
| ".rtf"
|
||||
| ".odt"
|
||||
| ".epub"
|
||||
| ".csv"
|
||||
| ".log"
|
||||
| ".conf"
|
||||
| ".ini"
|
||||
| ".properties"
|
||||
| ".sql"
|
||||
| ".bat"
|
||||
| ".sh"
|
||||
| ".c"
|
||||
| ".cpp"
|
||||
| ".py"
|
||||
| ".java"
|
||||
| ".js"
|
||||
| ".ts"
|
||||
| ".swift"
|
||||
| ".go"
|
||||
| ".rb"
|
||||
| ".php"
|
||||
| ".css"
|
||||
| ".scss"
|
||||
| ".less"
|
||||
):
|
||||
content = file.decode("utf-8")
|
||||
|
||||
case ".pdf":
|
||||
if not pm.is_installed("pypdf2"):
|
||||
pm.install("pypdf2")
|
||||
|
1098
lightrag/api/webui/assets/index-BDX8o1Ld.js
Normal file
1098
lightrag/api/webui/assets/index-BDX8o1Ld.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,8 +5,8 @@
|
||||
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lightrag</title>
|
||||
<script type="module" crossorigin src="./assets/index-gr1CNi7P.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-Cq9iD15S.css">
|
||||
<script type="module" crossorigin src="./assets/index-BDX8o1Ld.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-CLsJV-0i.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
@@ -7,7 +7,10 @@
|
||||
"dev": "bunx --bun vite",
|
||||
"build": "bunx --bun vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "bunx --bun vite preview"
|
||||
"preview": "bunx --bun vite preview",
|
||||
"dev-no-bun": "vite",
|
||||
"build-no-bun": "vite build --emptyOutDir",
|
||||
"preview-no-bun": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^9.5.0",
|
||||
|
@@ -80,7 +80,7 @@ export default function UploadDocumentsDialog() {
|
||||
<FileUploader
|
||||
maxFileCount={Infinity}
|
||||
maxSize={200 * 1024 * 1024}
|
||||
description="supported types: TXT, MD, DOC, PDF, PPTX"
|
||||
description="supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"
|
||||
onUpload={handleDocumentsUpload}
|
||||
progresses={progresses}
|
||||
disabled={isUploading}
|
||||
|
@@ -247,7 +247,7 @@ function FileUploader(props: FileUploaderProps) {
|
||||
? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}
|
||||
files (up to ${formatBytes(maxSize)} each)`
|
||||
: ` a file with ${formatBytes(maxSize)}`}
|
||||
Supported formats: TXT, MD, DOC, PDF, PPTX
|
||||
Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
@@ -26,7 +26,12 @@ export const defaultQueryLabel = '*'
|
||||
|
||||
// reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types
|
||||
export const supportedFileTypes = {
|
||||
'text/plain': ['.txt', '.md'],
|
||||
'text/plain': [
|
||||
'.txt', '.md', '.html', '.htm', '.tex', '.json', '.xml', '.yaml', '.yml',
|
||||
'.rtf', '.odt', '.epub', '.csv', '.log', '.conf', '.ini', '.properties',
|
||||
'.sql', '.bat', '.sh', '.c', '.cpp', '.py', '.java', '.js', '.ts',
|
||||
'.swift', '.go', '.rb', '.php', '.css', '.scss', '.less'
|
||||
],
|
||||
'application/pdf': ['.pdf'],
|
||||
'application/msword': ['.doc'],
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx'],
|
||||
|
Reference in New Issue
Block a user