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
f9065650
Unverified
Commit
f9065650
authored
1 year ago
by
BeatrixCohere
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[Cohere] Add client name to Cohere calls (#10384)
Add client name to cohere calls
parent
7d9b24cc
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
llama_index/embeddings/cohereai.py
+1
-1
1 addition, 1 deletion
llama_index/embeddings/cohereai.py
llama_index/finetuning/rerankers/cohere_reranker.py
+1
-1
1 addition, 1 deletion
llama_index/finetuning/rerankers/cohere_reranker.py
llama_index/llms/cohere.py
+2
-2
2 additions, 2 deletions
llama_index/llms/cohere.py
with
4 additions
and
4 deletions
llama_index/embeddings/cohereai.py
+
1
−
1
View file @
f9065650
...
@@ -111,7 +111,7 @@ class CohereEmbedding(BaseEmbedding):
...
@@ -111,7 +111,7 @@ class CohereEmbedding(BaseEmbedding):
raise
ValueError
(
f
"
truncate must be one of
{
VALID_TRUNCATE_OPTIONS
}
"
)
raise
ValueError
(
f
"
truncate must be one of
{
VALID_TRUNCATE_OPTIONS
}
"
)
super
().
__init__
(
super
().
__init__
(
cohere_client
=
cohere
.
Client
(
cohere_api_key
),
cohere_client
=
cohere
.
Client
(
cohere_api_key
,
client_name
=
"
llama_index
"
),
cohere_api_key
=
cohere_api_key
,
cohere_api_key
=
cohere_api_key
,
model_name
=
model_name
,
model_name
=
model_name
,
truncate
=
truncate
,
truncate
=
truncate
,
...
...
This diff is collapsed.
Click to expand it.
llama_index/finetuning/rerankers/cohere_reranker.py
+
1
−
1
View file @
f9065650
...
@@ -38,7 +38,7 @@ class CohereRerankerFinetuneEngine(BaseCohereRerankerFinetuningEngine):
...
@@ -38,7 +38,7 @@ class CohereRerankerFinetuneEngine(BaseCohereRerankerFinetuningEngine):
"
Must pass in cohere api key or
"
"
Must pass in cohere api key or
"
"
specify via COHERE_API_KEY environment variable
"
"
specify via COHERE_API_KEY environment variable
"
)
)
self
.
_model
=
cohere
.
Client
(
self
.
api_key
)
self
.
_model
=
cohere
.
Client
(
self
.
api_key
,
client_name
=
"
llama_index
"
)
self
.
_train_file_name
=
train_file_name
self
.
_train_file_name
=
train_file_name
self
.
_val_file_name
=
val_file_name
self
.
_val_file_name
=
val_file_name
self
.
_model_name
=
model_name
self
.
_model_name
=
model_name
...
...
This diff is collapsed.
Click to expand it.
llama_index/llms/cohere.py
+
2
−
2
View file @
f9065650
...
@@ -69,8 +69,8 @@ class Cohere(LLM):
...
@@ -69,8 +69,8 @@ class Cohere(LLM):
additional_kwargs
=
additional_kwargs
or
{}
additional_kwargs
=
additional_kwargs
or
{}
callback_manager
=
callback_manager
or
CallbackManager
([])
callback_manager
=
callback_manager
or
CallbackManager
([])
self
.
_client
=
cohere
.
Client
(
api_key
)
self
.
_client
=
cohere
.
Client
(
api_key
,
client_name
=
"
llama_index
"
)
self
.
_aclient
=
cohere
.
AsyncClient
(
api_key
)
self
.
_aclient
=
cohere
.
AsyncClient
(
api_key
,
client_name
=
"
llama_index
"
)
super
().
__init__
(
super
().
__init__
(
temperature
=
temperature
,
temperature
=
temperature
,
...
...
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