bump python min ver to 3.9

pull/385/head
evelynmitchell 1 year ago
parent 301354978a
commit b682e87bf2

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.8", "3.9", "3.10"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}

@ -16,7 +16,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

@ -15,7 +15,6 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- "3.8"
- "3.9" - "3.9"
- "3.10" - "3.10"
- "3.11" - "3.11"
@ -77,7 +76,6 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- "3.8"
- "3.9" - "3.9"
- "3.10" - "3.10"
- "3.11" - "3.11"

@ -16,7 +16,7 @@ Swarms provides you with all the building blocks you need to build reliable, pro
## 💻 Install ## 💻 Install
You can install `swarms` with pip in a You can install `swarms` with pip in a
[**Python>=3.8**](https://www.python.org/) environment. [**Python>=3.9**](https://www.python.org/) environment.
!!! example "pip install (recommended)" !!! example "pip install (recommended)"

@ -23,7 +23,7 @@ classifiers = [
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8.1" python = "^3.9"
torch = "2.1.1" torch = "2.1.1"
transformers = "4.37.1" transformers = "4.37.1"
openai = "0.28.0" openai = "0.28.0"

@ -674,17 +674,6 @@ class BaseOpenAI(BaseLLM):
def get_token_ids(self, text: str) -> List[int]: def get_token_ids(self, text: str) -> List[int]:
"""Get the token IDs using the tiktoken package.""" """Get the token IDs using the tiktoken package."""
# tiktoken NOT supported for Python < 3.8
if sys.version_info[1] < 8:
return super().get_num_tokens(text)
try:
import tiktoken
except ImportError:
raise ImportError(
"Could not import tiktoken python package. This is"
" needed in order to calculate get_num_tokens. Please"
" install it with `pip install tiktoken`."
)
model_name = self.tiktoken_model_name or self.model_name model_name = self.tiktoken_model_name or self.model_name
try: try:

Loading…
Cancel
Save