From fa0fcc2c89013ef7df9b02e77eb22a569272e1bf Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 12 Jun 2023 12:09:23 +0800 Subject: [PATCH] add support for python3.8 3.9 --- backend-python/requirements_versions.txt | Bin 312 -> 312 bytes backend-python/routes/state_cache.py | 4 ++-- backend-python/rwkv_pip/rwkv_tokenizer.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend-python/requirements_versions.txt b/backend-python/requirements_versions.txt index df9e09ea8a34ec0a43e4f4acd12fd5c2e511e7aa..79a0167796e3695c8bf307c63f9c65363251ee8d 100644 GIT binary patch delta 12 TcmdnNw1a7a3Zv;pRbfT|8R-K_ delta 12 TcmdnNw1a7a3ZuzJRbfT|8RP>< diff --git a/backend-python/routes/state_cache.py b/backend-python/routes/state_cache.py index b8a836f..b3b8922 100644 --- a/backend-python/routes/state_cache.py +++ b/backend-python/routes/state_cache.py @@ -1,4 +1,4 @@ -from typing import Any, Dict +from typing import Any, Dict, List from utils.log import quick_log from fastapi import APIRouter, HTTPException, Request, Response, status from pydantic import BaseModel @@ -31,7 +31,7 @@ def init(): class AddStateBody(BaseModel): prompt: str - tokens: list[str] + tokens: List[str] state: Any logits: Any diff --git a/backend-python/rwkv_pip/rwkv_tokenizer.py b/backend-python/rwkv_pip/rwkv_tokenizer.py index 2d275f5..e969eac 100644 --- a/backend-python/rwkv_pip/rwkv_tokenizer.py +++ b/backend-python/rwkv_pip/rwkv_tokenizer.py @@ -72,9 +72,9 @@ class TRIE_TOKENIZER: for t, i in self.token2idx.items(): _ = self.root.add(t, val=(t, i)) - def encodeBytes(self, src: bytes) -> list[int]: + def encodeBytes(self, src: bytes): idx: int = 0 - tokens: list[int] = [] + tokens = [] while idx < len(src): _idx: int = idx idx, _, values = self.root.find_longest(src, idx)