[DOCKERFILE]

pull/767/head
Kye Gomez 3 months ago
parent a88127b820
commit abb7aa605a

1
.gitignore vendored

@ -14,6 +14,7 @@ static/generated
runs runs
Financial-Analysis-Agent_state.json Financial-Analysis-Agent_state.json
experimental experimental
ffn_alternatives
artifacts_five artifacts_five
encryption encryption
errors errors

@ -20,6 +20,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Install swarms packages # Install swarms packages
RUN pip install --no-cache-dir swarm-models swarms RUN pip install --no-cache-dir swarm-models swarms
RUN pip install transformers torch litellm tiktoken openai pandas numpy pypdf
# Production stage # Production stage
FROM python:3.11-slim-bullseye FROM python:3.11-slim-bullseye

@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "swarms" name = "swarms"
version = "7.0.1" version = "7.0.3"
description = "Swarms - TGSC" description = "Swarms - TGSC"
license = "MIT" license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"] authors = ["Kye Gomez <kye@apac.ai>"]

@ -2,8 +2,8 @@ from swarms import Agent
Agent( Agent(
agent_name="Stock-Analysis-Agent", agent_name="Stock-Analysis-Agent",
model_name="gpt-4o-mini", model_name="groq/deepseek-r1-distill-llama-70b",
max_loops="auto", max_loops="auto",
interactive=True, interactive=True,
streaming_on=True, streaming_on=False,
).run("What are 5 hft algorithms") ).run("What are the best ways to analyze macroeconomic data?")

@ -1,12 +1,10 @@
from typing import Any, Optional, Callable from typing import Any, Optional, Callable
from swarms.tools.json_former import Jsonformer from swarms.tools.json_former import Jsonformer
from swarms.utils.loguru_logger import initialize_logger from swarms.utils.loguru_logger import initialize_logger
from swarms.utils.lazy_loader import lazy_import_decorator
logger = initialize_logger(log_folder="tool_agent") logger = initialize_logger(log_folder="tool_agent")
@lazy_import_decorator
class ToolAgent: class ToolAgent:
""" """
Represents a tool agent that performs a specific task using a model and tokenizer. Represents a tool agent that performs a specific task using a model and tokenizer.

@ -563,7 +563,7 @@ class Agent:
max_loops=self.max_loops, max_loops=self.max_loops,
steps=self.short_memory.to_dict(), steps=self.short_memory.to_dict(),
full_history=self.short_memory.get_str(), 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, stopping_token=self.stopping_token,
interactive=self.interactive, interactive=self.interactive,
dynamic_temperature_enabled=self.dynamic_temperature_enabled, dynamic_temperature_enabled=self.dynamic_temperature_enabled,

@ -8,7 +8,6 @@ from tenacity import retry, stop_after_attempt, wait_exponential
from swarms.utils.auto_download_check_packages import ( from swarms.utils.auto_download_check_packages import (
auto_check_and_download_package, auto_check_and_download_package,
) )
from swarms.utils.lazy_loader import lazy_import_decorator
from swarms.utils.loguru_logger import initialize_logger from swarms.utils.loguru_logger import initialize_logger
logger = initialize_logger(log_folder="swarm_matcher") logger = initialize_logger(log_folder="swarm_matcher")
@ -29,7 +28,6 @@ class SwarmMatcherConfig(BaseModel):
) )
@lazy_import_decorator
class SwarmMatcher: class SwarmMatcher:
""" """
A class for matching tasks to swarm types based on their descriptions. A class for matching tasks to swarm types based on their descriptions.
@ -271,7 +269,6 @@ def initialize_swarm_types(matcher: SwarmMatcher):
logger.debug("Swarm types initialized") logger.debug("Swarm types initialized")
@lazy_import_decorator
def swarm_matcher(task: str, *args, **kwargs): def swarm_matcher(task: str, *args, **kwargs):
""" """
Runs the SwarmMatcher example with predefined tasks and swarm types. Runs the SwarmMatcher example with predefined tasks and swarm types.

@ -1,7 +1,6 @@
import json import json
from typing import Any, Dict, List, Union from typing import Any, Dict, List, Union
from swarms.utils.lazy_loader import lazy_import_decorator
from pydantic import BaseModel from pydantic import BaseModel
from swarms.tools.logits_processor import ( from swarms.tools.logits_processor import (
NumberStoppingCriteria, NumberStoppingCriteria,
@ -24,7 +23,6 @@ except ImportError:
GENERATION_MARKER = "|GENERATION|" GENERATION_MARKER = "|GENERATION|"
@lazy_import_decorator
class Jsonformer: class Jsonformer:
""" """
Initializes the FormatTools class. Initializes the FormatTools class.

@ -6,7 +6,8 @@ def count_tokens(text: str, model: str = "gpt-4o") -> int:
try: try:
from litellm import encode from litellm import encode
except ImportError: except ImportError:
subprocess.run(["pip", "install", "litellm"]) import sys
subprocess.run([sys.executable, "-m", "pip", "install", "litellm"])
from litellm import encode from litellm import encode
return len(encode(model=model, text=text)) return len(encode(model=model, text=text))

@ -4,8 +4,9 @@ try:
import pypdf import pypdf
except ImportError: except ImportError:
import subprocess import subprocess
import sys
subprocess.check_call(["python", "-m", "pip", "install", "pypdf"]) subprocess.check_call([sys.executable, "-m", "pip", "install", "pypdf"])
import pypdf import pypdf

Loading…
Cancel
Save