[DOCKERFILE]

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

1
.gitignore vendored

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

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

@ -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 <kye@apac.ai>"]

@ -2,8 +2,8 @@ from swarms import Agent
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?")

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

@ -563,7 +563,7 @@ class Agent:
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,

@ -8,7 +8,6 @@ from tenacity import retry, stop_after_attempt, wait_exponential
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")
@ -29,7 +28,6 @@ class SwarmMatcherConfig(BaseModel):
)
@lazy_import_decorator
class SwarmMatcher:
"""
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")
@lazy_import_decorator
def swarm_matcher(task: str, *args, **kwargs):
"""
Runs the SwarmMatcher example with predefined tasks and swarm types.

@ -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,
@ -24,7 +23,6 @@ except ImportError:
GENERATION_MARKER = "|GENERATION|"
@lazy_import_decorator
class Jsonformer:
"""
Initializes the FormatTools class.

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

@ -4,8 +4,9 @@ try:
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

Loading…
Cancel
Save