Skip to content

Commit

Permalink
Remove redundant check for "requests" module (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
kno10 authored Nov 28, 2023
1 parent 86b749a commit 20e3ed3
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions chromadb/utils/embedding_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ def __init__(
api_key (str): Your API key for the HuggingFace API.
model_name (str, optional): The name of the model to use for text embeddings. Defaults to "sentence-transformers/all-MiniLM-L6-v2".
"""
try:
import requests
except ImportError:
raise ValueError(
"The requests python package is not installed. Please install it with `pip install requests`"
)
self._api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_name}"
self._session = requests.Session()
self._session.headers.update({"Authorization": f"Bearer {api_key}"})
Expand Down Expand Up @@ -272,12 +266,6 @@ def __init__(
api_key (str): Your API key for the Jina AI API.
model_name (str, optional): The name of the model to use for text embeddings. Defaults to "jina-embeddings-v2-base-en".
"""
try:
import requests
except ImportError:
raise ValueError(
"The requests python package is not installed. Please install it with `pip install requests`"
)
self._model_name = model_name
self._api_url = 'https://api.jina.ai/v1/embeddings'
self._session = requests.Session()
Expand Down

0 comments on commit 20e3ed3

Please sign in to comment.