Skip to content

Commit

Permalink
[DOCKERFILE]
Browse files Browse the repository at this point in the history
  • Loading branch information
kyegomez committed Jan 29, 2025
1 parent a88127b commit abb7aa6
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static/generated
runs
Financial-Analysis-Agent_state.json
experimental
ffn_alternatives
artifacts_five
encryption
errors
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# Install swarms packages
RUN pip install --no-cache-dir swarm-models swarms
RUN pip install transformers torch litellm tiktoken openai pandas numpy pypdf


# Production stage
FROM python:3.11-slim-bullseye
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms"
version = "7.0.1"
version = "7.0.3"
description = "Swarms - TGSC"
license = "MIT"
authors = ["Kye Gomez <[email protected]>"]
Expand Down
6 changes: 3 additions & 3 deletions simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Agent(
agent_name="Stock-Analysis-Agent",
model_name="gpt-4o-mini",
model_name="groq/deepseek-r1-distill-llama-70b",
max_loops="auto",
interactive=True,
streaming_on=True,
).run("What are 5 hft algorithms")
streaming_on=False,
).run("What are the best ways to analyze macroeconomic data?")
2 changes: 0 additions & 2 deletions swarms/agents/tool_agent.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from typing import Any, Optional, Callable
from swarms.tools.json_former import Jsonformer
from swarms.utils.loguru_logger import initialize_logger
from swarms.utils.lazy_loader import lazy_import_decorator

logger = initialize_logger(log_folder="tool_agent")


@lazy_import_decorator
class ToolAgent:
"""
Represents a tool agent that performs a specific task using a model and tokenizer.
Expand Down
2 changes: 1 addition & 1 deletion swarms/structs/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def __init__(
max_loops=self.max_loops,
steps=self.short_memory.to_dict(),
full_history=self.short_memory.get_str(),
total_tokens=count_tokens(self.short_memory.get_str()),
total_tokens=count_tokens(text=self.short_memory.get_str()),
stopping_token=self.stopping_token,
interactive=self.interactive,
dynamic_temperature_enabled=self.dynamic_temperature_enabled,
Expand Down
3 changes: 0 additions & 3 deletions swarms/structs/swarm_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from swarms.utils.auto_download_check_packages import (
auto_check_and_download_package,
)
from swarms.utils.lazy_loader import lazy_import_decorator
from swarms.utils.loguru_logger import initialize_logger

logger = initialize_logger(log_folder="swarm_matcher")
Expand All @@ -29,7 +28,6 @@ class SwarmMatcherConfig(BaseModel):
)


@lazy_import_decorator
class SwarmMatcher:
"""
A class for matching tasks to swarm types based on their descriptions.
Expand Down Expand Up @@ -271,7 +269,6 @@ def initialize_swarm_types(matcher: SwarmMatcher):
logger.debug("Swarm types initialized")


@lazy_import_decorator
def swarm_matcher(task: str, *args, **kwargs):
"""
Runs the SwarmMatcher example with predefined tasks and swarm types.
Expand Down
2 changes: 0 additions & 2 deletions swarms/tools/json_former.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
from typing import Any, Dict, List, Union

from swarms.utils.lazy_loader import lazy_import_decorator
from pydantic import BaseModel
from swarms.tools.logits_processor import (
NumberStoppingCriteria,
Expand All @@ -24,7 +23,6 @@
GENERATION_MARKER = "|GENERATION|"


@lazy_import_decorator
class Jsonformer:
"""
Initializes the FormatTools class.
Expand Down
3 changes: 2 additions & 1 deletion swarms/utils/litellm_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ def count_tokens(text: str, model: str = "gpt-4o") -> int:
try:
from litellm import encode
except ImportError:
subprocess.run(["pip", "install", "litellm"])
import sys
subprocess.run([sys.executable, "-m", "pip", "install", "litellm"])
from litellm import encode

return len(encode(model=model, text=text))
Expand Down
3 changes: 2 additions & 1 deletion swarms/utils/pdf_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import pypdf
except ImportError:
import subprocess
import sys

subprocess.check_call(["python", "-m", "pip", "install", "pypdf"])
subprocess.check_call([sys.executable, "-m", "pip", "install", "pypdf"])
import pypdf


Expand Down

0 comments on commit abb7aa6

Please sign in to comment.