Merge branch 'kyegomez:master' into master

pull/307/head
pliny 1 year ago committed by GitHub
commit 79a9458ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

@ -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 <account>/<repo>
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}

@ -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

@ -60,8 +60,8 @@ llm = OpenAIChat(
agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True) agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True)
# Run the workflow on a task # Run the workflow on a task
out = agent.run("Generate a 10,000 word blog on health and wellness.") agent.run("Generate a 10,000 word blog on health and wellness.")
print(out)
``` ```
@ -168,8 +168,7 @@ agent = Agent(
) )
# Run the workflow on a task # Run the workflow on a task
out = agent.run(task=task, img=img) agent.run(task=task, img=img)
print(out)
``` ```
@ -199,8 +198,7 @@ llm = OpenAIChat(
agent = OmniModalAgent(llm) agent = OmniModalAgent(llm)
response = agent.run("Generate a video of a swarm of fish and then make an image out of the video") agent.run("Generate a video of a swarm of fish and then make an image out of the video")
print(response)
``` ```
--- ---

@ -29,5 +29,4 @@ agent = Agent(
) )
# Run the workflow on a task # Run the workflow on a task
out = agent.run("Generate a 10,000 word blog on health and wellness.") agent.run("Generate a 10,000 word blog on health and wellness.")
print(out)

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "swarms" name = "swarms"
version = "2.8.9" version = "2.9.2"
description = "Swarms - Pytorch" description = "Swarms - Pytorch"
license = "MIT" license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"] authors = ["Kye Gomez <kye@apac.ai>"]
@ -44,7 +44,7 @@ PyPDF2 = "3.0.1"
accelerate = "0.22.0" accelerate = "0.22.0"
sentencepiece = "0.1.98" sentencepiece = "0.1.98"
wget = "3.2" wget = "3.2"
tensorflow = "2.12.0" tensorflow = "2.14.0"
httpx = "0.24.1" httpx = "0.24.1"
tiktoken = "0.4.0" tiktoken = "0.4.0"
safetensors = "0.3.3" safetensors = "0.3.3"

@ -172,7 +172,7 @@ class Gemini(BaseMultiModalModel):
# return response.text # return response.text
# else: # else:
response = self.model.generate_content( response = self.model.generate_content(
task, *args, **kwargs task, stream=self.stream, *args, **kwargs
) )
return response.text return response.text
except Exception as error: except Exception as error:

@ -1,12 +1,11 @@
import subprocess
from typing import Optional, Tuple, List
from swarms.models.base_llm import AbstractLLM from swarms.models.base_llm import AbstractLLM
try: try:
from vllm import LLM, SamplingParams from vllm import LLM, SamplingParams
except ImportError as error: except ImportError as error:
print(f"[ERROR] [vLLM] {error}") print(f"[ERROR] [vLLM] {error}")
subprocess.run(["pip", "install", "vllm"]) # subprocess.run(["pip", "install", "vllm"])
# raise error
raise error raise error

Loading…
Cancel
Save