Skip to content

Commit

Permalink
change standard tests to pypi (#32)
Browse files Browse the repository at this point in the history
* change standard tests to pypi

* x
  • Loading branch information
efriis authored Nov 14, 2024
1 parent 19227fc commit dd6b906
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 29 deletions.
12 changes: 8 additions & 4 deletions libs/upstage/langchain_upstage/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ def get_token_ids(self, text: str) -> List[int]:
encode = tokenizer.encode(text, add_special_tokens=False)
return encode.ids

def get_num_tokens_from_messages(self, messages: List[BaseMessage]) -> int:
def get_num_tokens_from_messages(
self, messages: List[BaseMessage], tools: Sequence[Any] | None = None
) -> int:
"""Calculate num tokens for solar model."""
tokenizer = self._get_tokenizer()
tokens_per_message = 5 # <|im_start|>{role}\n{message}<|im_end|>
Expand Down Expand Up @@ -270,9 +272,11 @@ def _parse_documents(self, file_path: str) -> str:
document_contents = "Documents:\n"

loader = UpstageDocumentParseLoader(
api_key=self.upstage_api_key.get_secret_value()
if self.upstage_api_key
else None,
api_key=(
self.upstage_api_key.get_secret_value()
if self.upstage_api_key
else None
),
file_path=file_path,
output_format="text",
coordinates=False,
Expand Down
58 changes: 34 additions & 24 deletions libs/upstage/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/upstage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ syrupy = "^4.0.2"
pytest-watcher = "^0.3.4"
pytest-asyncio = "^0.21.1"
docarray = "^0.32.1"
langchain-standard-tests = { git = "https://github.com/langchain-ai/langchain.git", subdirectory = "libs/standard-tests" }
langchain-tests = "0.3.0"

[tool.poetry.group.codespell]
optional = true
Expand Down

0 comments on commit dd6b906

Please sign in to comment.