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
13c68c9a
Unverified
Commit
13c68c9a
authored
1 year ago
by
Logan
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
let huggingface embeddings load (#8119)
parent
6cb2a851
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llama_index/embeddings/huggingface.py
+3
-0
3 additions, 0 deletions
llama_index/embeddings/huggingface.py
llama_index/embeddings/loading.py
+4
-0
4 additions, 0 deletions
llama_index/embeddings/loading.py
with
7 additions
and
0 deletions
llama_index/embeddings/huggingface.py
+
3
−
0
View file @
13c68c9a
...
...
@@ -8,6 +8,7 @@ from llama_index.embeddings.huggingface_utils import (
get_query_instruct_for_model_name
,
get_text_instruct_for_model_name
,
)
from
llama_index.utils
import
get_cache_dir
class
HuggingFaceEmbedding
(
BaseEmbedding
):
...
...
@@ -60,6 +61,8 @@ class HuggingFaceEmbedding(BaseEmbedding):
device
=
"
cpu
"
self
.
_device
=
device
cache_folder
=
cache_folder
or
get_cache_dir
()
if
model
is
None
:
model_name
=
model_name
or
DEFAULT_HUGGINGFACE_EMBEDDING_MODEL
self
.
_model
=
AutoModel
.
from_pretrained
(
...
...
This diff is collapsed.
Click to expand it.
llama_index/embeddings/loading.py
+
4
−
0
View file @
13c68c9a
...
...
@@ -2,6 +2,8 @@ from typing import Dict, Type
from
llama_index.embeddings.base
import
BaseEmbedding
from
llama_index.embeddings.google
import
GoogleUnivSentEncoderEmbedding
from
llama_index.embeddings.huggingface
import
HuggingFaceEmbedding
from
llama_index.embeddings.huggingface_optimum
import
OptimumEmbedding
from
llama_index.embeddings.langchain
import
LangchainEmbedding
from
llama_index.embeddings.openai
import
OpenAIEmbedding
from
llama_index.embeddings.utils
import
resolve_embed_model
...
...
@@ -12,6 +14,8 @@ RECOGNIZED_EMBEDDINGS: Dict[str, Type[BaseEmbedding]] = {
OpenAIEmbedding
.
class_name
():
OpenAIEmbedding
,
LangchainEmbedding
.
class_name
():
LangchainEmbedding
,
MockEmbedding
.
class_name
():
MockEmbedding
,
HuggingFaceEmbedding
.
class_name
():
HuggingFaceEmbedding
,
OpenAIEmbedding
.
class_name
():
OpenAIEmbedding
,
}
...
...
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