Skip to content

Commit

Permalink
Merge pull request #30 from andri-jpg/main
Browse files Browse the repository at this point in the history
use pydantic.v1 in langchain.py
  • Loading branch information
LLukas22 authored Aug 19, 2023
2 parents e6fcfb0 + d6cf42e commit 3bc82ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions llm_rs/langchain/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
from typing import Any, Dict, Optional, Sequence, Union, List
import os

from pydantic import root_validator
try:
from pydantic.v1 import root_validator
except ImportError:
from pydantic import root_validator

from ..auto import AutoModel, KnownModels
from ..config import GenerationConfig, SessionConfig
Expand Down Expand Up @@ -121,4 +124,4 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]:

def embed_query(self, text: str) -> List[float]:
"""Embed query text."""
return self.model.embed(text)
return self.model.embed(text)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ documentation = "https://llukas22.github.io/llm-rs-python/"

[project.optional-dependencies]
convert = [ "transformers >= 4.29.0", "sentencepiece >= 0.1.99", "torch >= 2.0.0", "accelerate >= 0.19.0", "tqdm", "einops >= 0.6.1",]
langchain = [ "langchain>=0.0.190",]
langchain = [ "langchain>=0.0.266",]

haystack=[
"farm-haystack>=1.17.1"
Expand Down

0 comments on commit 3bc82ba

Please sign in to comment.