pull/153/merge
evelynmitchell 2 years ago committed by GitHub
commit e1f25d4ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,9 +17,15 @@ on:
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ "master" ] branches: [ "master" ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'tests/tools/base.py'
schedule: schedule:
- cron: '33 12 * * 5' - cron: '33 12 * * 5'
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze

@ -1,23 +0,0 @@
name: Quality
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
run: |
pylint `git diff --name-only --diff-filter=d origin/master HEAD | grep -E '\.py$' | tr '\n' ' '`

@ -38,6 +38,14 @@ Book a [1-on-1 Session with Kye](https://calendly.com/swarm-corp/30min), the Cre
## Usage ## Usage
We have a small gallery of examples to run here, [for more check out the docs to build your own agent and or swarms!](https://docs.apac.ai) We have a small gallery of examples to run here, [for more check out the docs to build your own agent and or swarms!](https://docs.apac.ai)
All of the examples assume you have set your API keys in the environment:
```bash
export OPENAI_API_KEY='yourapikey'
export ANTHROPIC_API_KEY='yourotherapikey'
```
### Example in Colab: ### Example in Colab:
<a target="_blank" href="https://colab.research.google.com/github/kyegomez/swarms/blob/master/playground/swarms_example.ipynb"> <a target="_blank" href="https://colab.research.google.com/github/kyegomez/swarms/blob/master/playground/swarms_example.ipynb">

@ -1,5 +1,8 @@
from swarms.models import OpenAIChat
from swarms.structs import Flow from swarms.structs import Flow
import os
openai_api_key = os.environ.get("OPENAI_API_KEY")
# Initialize the language model, this model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC # Initialize the language model, this model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
llm = OpenAIChat( llm = OpenAIChat(

@ -1,14 +1,17 @@
from swarms.models import OpenAIChat, BioGPT, Anthropic from swarms.models import OpenAIChat, BioGPT, Anthropic
from swarms.structs import Flow from swarms.structs import Flow
from swarms.structs.sequential_workflow import SequentialWorkflow from swarms.structs.sequential_workflow import SequentialWorkflow
import os
# Example usage # Example usage
api_key = "" # Your actual API key here
openai_api_key = os.environ.get("OPENAI_API_KEY")
anthropic_api_key = os.environ.get("ANTHROPIC_API_KEY")
# Initialize the language flow # Initialize the language flow
llm = OpenAIChat( llm = OpenAIChat(
openai_api_key=api_key, openai_api_key=openai_api_key,
temperature=0.5, temperature=0.5,
max_tokens=3000, max_tokens=3000,
) )
@ -16,7 +19,7 @@ llm = OpenAIChat(
biochat = BioGPT() biochat = BioGPT()
# Use Anthropic # Use Anthropic
anthropic = Anthropic() anthropic = Anthropic(anthropic_api_key=anthropic_api_key)
# Initialize the agent with the language flow # Initialize the agent with the language flow
agent1 = Flow(llm=llm, max_loops=1, dashboard=False) agent1 = Flow(llm=llm, max_loops=1, dashboard=False)

@ -2,7 +2,6 @@
LayoutLMDocumentQA is a multimodal good for LayoutLMDocumentQA is a multimodal good for
visual question answering on real world docs lik invoice, pdfs, etc visual question answering on real world docs lik invoice, pdfs, etc
""" """
from transformers import pipeline
class LayoutLMDocumentQA: class LayoutLMDocumentQA:
@ -24,7 +23,6 @@ class LayoutLMDocumentQA:
def __init__( def __init__(
self, self,
model_name: str = "impira/layoutlm-document-qa", model_name: str = "impira/layoutlm-document-qa",
task_type: str = "document-question-answering",
): ):
self.model_name = model_name self.model_name = model_name
self.task_type = task_type self.task_type = task_type

Loading…
Cancel
Save