pull/55/head
Kye 1 year ago
parent 8bf8dc8946
commit 1167f016fe

@ -1,16 +1,16 @@
#from shapeless import shapeless # #from shapeless import shapeless
#@shapeless # #@shapeless
class ErrorArtifact: # class ErrorArtifact:
def __init__( # def __init__(
self, # self,
value # value
): # ):
self.value = value # self.value = value
def __add__(self, other): # def __add__(self, other):
return ErrorArtififact(self.value + other.value) # return ErrorArtififact(self.value + other.value)
def to_text(self) -> str: # def to_text(self) -> str:
return self.value # return self.value

@ -3,7 +3,16 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
class Petals: class Petals:
"""Petals Bloom models.""" """Petals Bloom models."""
def __init__(self, model_name="bigscience/bloom-petals", temperature=0.7, max_new_tokens=256, top_p=0.9, top_k=None, do_sample=True, max_length=None): def __init__(
self,
model_name="bigscience/bloom-petals",
temperature=0.7,
max_new_tokens=256,
top_p=0.9,
top_k=None,
do_sample=True,
max_length=None
):
self.model_name = model_name self.model_name = model_name
self.temperature = temperature self.temperature = temperature
self.max_new_tokens = max_new_tokens self.max_new_tokens = max_new_tokens

@ -9,7 +9,6 @@ from logging import Logger
from typing import Optional, Union from typing import Optional, Union
from rich.logging import RichHandler from rich.logging import RichHandler
#from shapeless import shapeless
from swarms.artifacts.error_artifact import ErrorArtifact from swarms.artifacts.error_artifact import ErrorArtifact
from swarms.structs.task import BaseTask from swarms.structs.task import BaseTask

Loading…
Cancel
Save