Skip to content

Commit

Permalink
fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
igochkov committed Oct 28, 2024
1 parent e5df45a commit cbb986b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ RUN pip install --no-cache-dir -r requirements.txt && \
# Stage 3: Final stage with non-root user and app
FROM gpt-researcher-install AS gpt-researcher

# Use environment variables for API keys (defaults can be overridden at runtime)
ARG OPENAI_API_KEY
ARG TAVILY_API_KEY

ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV TAVILY_API_KEY=${TAVILY_API_KEY}

# Create a non-root user for security
RUN useradd -ms /bin/bash gpt-researcher && \
chown -R gpt-researcher:gpt-researcher /usr/src/app
Expand Down
2 changes: 1 addition & 1 deletion gpt_researcher/llm_provider/generic/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def from_provider(cls, provider: str, **kwargs: Any):
llm = ChatFireworks(**kwargs)
elif provider == "ollama":
_check_pkg("langchain_community")
from langchain_community.chat_models import ChatOllama
from langchain_ollama import ChatOllama

llm = ChatOllama(base_url=os.environ["OLLAMA_BASE_URL"], **kwargs)
elif provider == "together":
Expand Down
2 changes: 1 addition & 1 deletion gpt_researcher/memory/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, embedding_provider: str, model: str, **embdding_kwargs: Any):
_embeddings = None
match embedding_provider:
case "ollama":
from langchain_community.embeddings import OllamaEmbeddings
from langchain_ollama import OllamaEmbeddings

_embeddings = OllamaEmbeddings(
model=model,
Expand Down
2 changes: 1 addition & 1 deletion gpt_researcher/scraper/arxiv/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def scrape(self):
"""
query = self.link.split("/")[-1]
retriever = ArxivRetriever(load_max_docs=2, doc_content_chars_max=None)
docs = retriever.get_relevant_documents(query=query)
docs = retriever.invoke(query=query)
return docs[0].page_content

0 comments on commit cbb986b

Please sign in to comment.