[FEAT][TogetherModel]

pull/359/head
Kye 1 year ago
parent 393741b9aa
commit 368aa92ab2

@ -0,0 +1,10 @@
from swarms import TogetherModel
# Initialize the model with your parameters
model = TogetherModel(
model_name = "mistralai/Mixtral-8x7B-Instruct-v0.1",
max_tokens=1000,
)
# Run the model
model.run("Generate a blog post about the best way to make money online.")

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

@ -22,6 +22,7 @@ from swarms.models.modelscope_pipeline import ModelScopePipeline
from swarms.models.modelscope_llm import (
ModelScopeAutoModel,
) # noqa: E402
from swarms.models.together import TogetherModel # noqa: E402
################# MultiModal Models
from swarms.models.base_multimodal_model import (
@ -93,4 +94,5 @@ __all__ = [
"CogAgent",
"ModelScopePipeline",
"ModelScopeAutoModel",
"TogetherModel",
]

@ -3,9 +3,14 @@ from dataclasses import dataclass
@dataclass
class BlockDevice:
device: str
cluster: str
description: str
"""
Represents a block device.
Attributes:
device (str): The device name.
cluster (str): The cluster name.
description (str): A description of the block device.
"""
def __init__(self, device: str, cluster: str, description: str):
self.device = device

@ -4,6 +4,27 @@ from swarms.structs.base import BaseStructure
class LoadBalancer(BaseStructure):
"""
A load balancer class that distributes tasks among multiple workers.
Args:
num_workers (int): The number of worker processes to create.
agents (Optional[List]): A list of agents to assign to the load balancer.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
Attributes:
num_workers (int): The number of worker processes.
agents (Optional[List]): A list of agents assigned to the load balancer.
tasks (List): A list of tasks to be executed.
results (List): A list of results from the executed tasks.
workers (List): A list of worker processes.
Methods:
add_task: Add a task to the load balancer.
"""
def __init__(
self,
num_workers: int = 1,

Loading…
Cancel
Save