diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 6ed5bcba..00000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Docker Image CI - -on: # yamllint disable-line rule:truthy - push: - branches: ["master"] - pull_request: - branches: ["master"] - -jobs: - - build: - - runs-on: ubuntu-latest - name: Build Docker image - steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 17c14973..00000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Docker - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - schedule: - - cron: '31 19 * * *' - push: - branches: [ "master" ] - # Publish semver tags as releases. - tags: [ 'v*.*.*' ] - pull_request: - branches: [ "master" ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Install the cosign tool except on PR - # https://github.com/sigstore/cosign-installer - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 #v3.2.0 - with: - cosign-release: 'v2.1.1' - - # Set up BuildKit Docker container builder to be able to build - # multi-platform images and export cache - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - # Build and push Docker image with Buildx (don't push on PR) - # https://github.com/docker/build-push-action - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - # Sign the resulting Docker image digest except on PRs. - # This will only write to the public Rekor transparency log when the Docker - # repository is public to avoid leaking data. If you would like to publish - # transparency data even for private images, pass --force to cosign below. - # https://github.com/sigstore/cosign - - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} - env: - # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - TAGS: ${{ steps.meta.outputs.tags }} - DIGEST: ${{ steps.build-and-push.outputs.digest }} - # This step uses the identity token to provision an ephemeral certificate - # against the sigstore community Fulcio instance. - run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml deleted file mode 100644 index 51c99bba..00000000 --- a/.github/workflows/python-package-conda.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Python Package using Conda - -on: [push] - -jobs: - build-linux: - runs-on: ubuntu-latest - strategy: - max-parallel: 5 - - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH - - name: Install dependencies - run: | - conda env update --file environment.yml --name base - - name: Lint with flake8 - run: | - conda install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - conda install pytest - pytest diff --git a/README.md b/README.md index be68f685..e52b872d 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ llm = OpenAIChat( agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True) # Run the workflow on a task -out = agent.run("Generate a 10,000 word blog on health and wellness.") -print(out) +agent.run("Generate a 10,000 word blog on health and wellness.") + ``` @@ -168,8 +168,7 @@ agent = Agent( ) # Run the workflow on a task -out = agent.run(task=task, img=img) -print(out) +agent.run(task=task, img=img) ``` @@ -199,8 +198,7 @@ llm = OpenAIChat( agent = OmniModalAgent(llm) -response = agent.run("Generate a video of a swarm of fish and then make an image out of the video") -print(response) +agent.run("Generate a video of a swarm of fish and then make an image out of the video") ``` --- diff --git a/example.py b/example.py index cea307b0..f8d04047 100644 --- a/example.py +++ b/example.py @@ -29,5 +29,4 @@ agent = Agent( ) # Run the workflow on a task -out = agent.run("Generate a 10,000 word blog on health and wellness.") -print(out) +agent.run("Generate a 10,000 word blog on health and wellness.") diff --git a/pyproject.toml b/pyproject.toml index a49b0d8b..7022250b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "2.8.9" +version = "2.9.2" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "] @@ -44,7 +44,7 @@ PyPDF2 = "3.0.1" accelerate = "0.22.0" sentencepiece = "0.1.98" wget = "3.2" -tensorflow = "2.12.0" +tensorflow = "2.14.0" httpx = "0.24.1" tiktoken = "0.4.0" safetensors = "0.3.3" diff --git a/swarms/models/gemini.py b/swarms/models/gemini.py index 28fa7c85..ca505858 100644 --- a/swarms/models/gemini.py +++ b/swarms/models/gemini.py @@ -172,7 +172,7 @@ class Gemini(BaseMultiModalModel): # return response.text # else: response = self.model.generate_content( - task, *args, **kwargs + task, stream=self.stream, *args, **kwargs ) return response.text except Exception as error: diff --git a/swarms/models/vllm.py b/swarms/models/vllm.py index 650356cc..0ea4be4a 100644 --- a/swarms/models/vllm.py +++ b/swarms/models/vllm.py @@ -1,12 +1,11 @@ -import subprocess -from typing import Optional, Tuple, List from swarms.models.base_llm import AbstractLLM try: from vllm import LLM, SamplingParams except ImportError as error: print(f"[ERROR] [vLLM] {error}") - subprocess.run(["pip", "install", "vllm"]) + # subprocess.run(["pip", "install", "vllm"]) + # raise error raise error