Spaces:
Sleeping
Sleeping
Update agent.py
Browse files8 unmodified lines91011121314151617181920212223242526272829308 unmodified linesIf you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."""from transformers import pipelineSYSTEM_PROMPT = """...""" # oförändratclass GaiaAgent:def __init__(self, model_id="tiiuae/falcon-rw-1b"):self.generator = pipeline("text-generation",model=model_id,tokenizer=model_id,max_new_tokens=512,device="cpu", # viktigt!return_full_text=False)def __call__(self, question: str) -> tuple[str, str]:try:prompt = f"{SYSTEM_PROMPT}\n\n{question}\nFINAL ANSWER:"8 unmodified lines9101112131415161718192021222324258 unmodified linesIf you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."""class GaiaAgent:def __init__(self, model_id="google/flan-t5-base"):self.generator = pipeline("text2text-generation",model=model_id,tokenizer=model_id,max_new_tokens=512,device="cpu")def __call__(self, question: str) -> tuple[str, str]:try:prompt = f"{SYSTEM_PROMPT}\n\n{question}\nFINAL ANSWER:"
agent.py+3-8