Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
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
Llama Index
Commits
f8511acb
Unverified
Commit
f8511acb
authored
1 year ago
by
Ming
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: + the linter `mypy` as a pre-commit hook (#9791)
parent
0a872ee1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pre-commit-config.yaml
+14
-0
14 additions, 0 deletions
.pre-commit-config.yaml
llama_index/embeddings/pooling.py
+3
-1
3 additions, 1 deletion
llama_index/embeddings/pooling.py
tests/vector_stores/test_elasticsearch.py
+1
-0
1 addition, 0 deletions
tests/vector_stores/test_elasticsearch.py
with
18 additions
and
1 deletion
.pre-commit-config.yaml
+
14
−
0
View file @
f8511acb
...
@@ -34,6 +34,20 @@ repos:
...
@@ -34,6 +34,20 @@ repos:
name
:
black-src
name
:
black-src
alias
:
black
alias
:
black
exclude
:
^(docs/|llama_index/_static)
exclude
:
^(docs/|llama_index/_static)
-
repo
:
https://github.com/pre-commit/mirrors-mypy
rev
:
v1.0.1
hooks
:
-
id
:
mypy
additional_dependencies
:
[
"
types-requests"
,
"
types-Deprecated"
,
"
types-redis"
,
"
types-setuptools"
,
"
types-PyYAML"
,
"
types-protobuf"
,
]
exclude
:
^(docs/|llama_index/_static)
-
repo
:
https://github.com/psf/black-pre-commit-mirror
-
repo
:
https://github.com/psf/black-pre-commit-mirror
rev
:
23.10.1
rev
:
23.10.1
hooks
:
hooks
:
...
...
This diff is collapsed.
Click to expand it.
llama_index/embeddings/pooling.py
+
3
−
1
View file @
f8511acb
...
@@ -25,7 +25,9 @@ class Pooling(str, Enum):
...
@@ -25,7 +25,9 @@ class Pooling(str, Enum):
@classmethod
@classmethod
@overload
@overload
def
cls_pooling
(
cls
,
array
:
"
torch.Tensor
"
)
->
"
torch.Tensor
"
:
# TODO: Remove this `type: ignore` after the false positive problem
# is addressed in mypy: https://github.com/python/mypy/issues/15683 .
def
cls_pooling
(
cls
,
array
:
"
torch.Tensor
"
)
->
"
torch.Tensor
"
:
# type: ignore
...
...
@classmethod
@classmethod
...
...
This diff is collapsed.
Click to expand it.
tests/vector_stores/test_elasticsearch.py
+
1
−
0
View file @
f8511acb
...
@@ -87,6 +87,7 @@ def elasticsearch_connection() -> Union[dict, Generator[dict, None, None]]:
...
@@ -87,6 +87,7 @@ def elasticsearch_connection() -> Union[dict, Generator[dict, None, None]]:
if
index_name
.
startswith
(
"
test_
"
):
if
index_name
.
startswith
(
"
test_
"
):
es
.
indices
.
delete
(
index
=
index_name
)
es
.
indices
.
delete
(
index
=
index_name
)
es
.
indices
.
refresh
(
index
=
"
_all
"
)
es
.
indices
.
refresh
(
index
=
"
_all
"
)
return
{}
@pytest.fixture
(
scope
=
"
session
"
)
@pytest.fixture
(
scope
=
"
session
"
)
...
...
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