Former-commit-id: 1167f016fe
group-chat
Kye 1 year ago
parent 831cbf9a2e
commit c9c312b671

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

@ -3,7 +3,16 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
class Petals:
"""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.temperature = temperature
self.max_new_tokens = max_new_tokens

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

Loading…
Cancel
Save