Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Create Llama
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Create Llama
Commits
c011455d
Unverified
Commit
c011455d
authored
6 months ago
by
Huu Le
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix cannot upload file (#286)
parent
38a8be8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/components/services/python/file.py
+7
-2
7 additions, 2 deletions
templates/components/services/python/file.py
with
7 additions
and
2 deletions
templates/components/services/python/file.py
+
7
−
2
View file @
c011455d
...
...
@@ -3,7 +3,7 @@ import mimetypes
import
os
from
io
import
BytesIO
from
pathlib
import
Path
from
typing
import
Any
,
List
,
Tuple
from
typing
import
List
,
Optional
,
Tuple
from
app.engine.index
import
IndexConfig
,
get_index
from
llama_index.core
import
VectorStoreIndex
...
...
@@ -72,7 +72,12 @@ class PrivateFileService:
return
documents
@staticmethod
def
process_file
(
file_name
:
str
,
base64_content
:
str
,
params
:
Any
)
->
List
[
str
]:
def
process_file
(
file_name
:
str
,
base64_content
:
str
,
params
:
Optional
[
dict
]
=
None
)
->
List
[
str
]:
if
params
is
None
:
params
=
{}
file_data
,
extension
=
PrivateFileService
.
preprocess_base64_file
(
base64_content
)
# Add the nodes to the index and persist it
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment