test fixes

This commit is contained in:
frdel 2025-04-01 17:18:57 +02:00
parent f473d64dfc
commit fbb0a072cd
3 changed files with 11 additions and 12 deletions

View file

@ -2,7 +2,7 @@
# Install necessary packages
apt-get install -y \
python3.12-dev python3-babel python3.12-venv \
python3-dev python3-babel python3-venv \
uwsgi uwsgi-plugin-python3 \
git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev

View file

@ -2,8 +2,8 @@
# Update and install necessary packages
apt-get update && apt-get install -y \
python3.12 \
python3.12-venv \
python3 \
python3-venv \
nodejs \
npm \
openssh-server \
@ -13,18 +13,18 @@ apt-get update && apt-get install -y \
git \
ffmpeg
# Configure system alternatives so that /usr/bin/python3 points to Python 3.12
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
sudo update-alternatives --set python3 /usr/bin/python3.12
# # Configure system alternatives so that /usr/bin/python3 points to Python 3.12
# sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
# sudo update-alternatives --set python3 /usr/bin/python3.12
# Update pip3 symlink: if pip3.12 exists, point pip3 to it;
# otherwise, install pip using Python 3.12's ensurepip.
if [ -f /usr/bin/pip3.12 ]; then
sudo ln -sf /usr/bin/pip3.12 /usr/bin/pip3
else
# if [ -f /usr/bin/pip3.12 ]; then
# sudo ln -sf /usr/bin/pip3.12 /usr/bin/pip3
# else
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip
fi
# fi
# Prepare SSH daemon
bash /ins/setup_ssh.sh "$@"

View file

@ -4,7 +4,7 @@ from collections import OrderedDict
from collections.abc import Mapping
import json
import math
from typing import Coroutine, Literal, TypedDict, cast, Union, Dict, List, Any, override
from typing import Coroutine, Literal, TypedDict, cast, Union, Dict, List, Any
from python.helpers import messages, tokens, settings, call_llm
from enum import Enum
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage, AIMessage
@ -82,7 +82,6 @@ class Message(Record):
self.summary: str = ""
self.tokens: int = tokens or self.calculate_tokens()
@override
def get_tokens(self) -> int:
if not self.tokens:
self.tokens = self.calculate_tokens()