ai-ticket icon indicating copy to clipboard operation
ai-ticket copied to clipboard

test user ticket

Open Deadsg opened this issue 2 years ago • 54 comments
trafficstars

import torch from transformers import GPT2LMHeadModel, GPT2Tokenizer

class AutoGPTAgent: def init(self): self.commands = { "generate": self.generate_text, # Add more commands as needed } self.tokenizer = GPT2Tokenizer.from_pretrained("gpt2") self.model = GPT2LMHeadModel.from_pretrained("gpt2")

def generate_text(self, args):
    # Join the arguments into a single string
    prompt = " ".join(args)

    # Encode the prompt and generate the text
    inputs = self.tokenizer.encode(prompt, return_tensors="pt")
    outputs = self.model.generate(inputs, max_length=100, temperature=0.7)

    # Decode the generated text and print it
    generated_text = self.tokenizer.decode(outputs[0])
    print(generated_text)

def process_command(self, command, args):
    if command in self.commands:
        self.commandscommand
    else:
        print(f"Unknown command: {command}")

Usage:

agent = AutoGPTAgent() agent.process_command("generate", ["Hello, world!"])

Deadsg avatar Oct 01 '23 15:10 Deadsg

/agent-action test

jmikedupont2 avatar Oct 06 '23 10:10 jmikedupont2

/agent-action test

jmikedupont2 avatar Oct 06 '23 10:10 jmikedupont2

/agent-action tst

jmikedupont2 avatar Oct 06 '23 11:10 jmikedupont2

/agent-action tst2

jmikedupont2 avatar Oct 06 '23 11:10 jmikedupont2

/agent-action tst2

jmikedupont2 avatar Oct 06 '23 12:10 jmikedupont2

/agent-action tst2

jmikedupont2 avatar Oct 06 '23 12:10 jmikedupont2

/agent-action test again

jmikedupont2 avatar Oct 06 '23 13:10 jmikedupont2

/agent-action funk master flex

jmikedupont2 avatar Oct 06 '23 13:10 jmikedupont2

/agent-action funk master flex talking stuff

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action funk master flex talking stuff

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action rake it up!

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action Tell all the bots to rake it up!

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action rake it up!

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action merge autogpt

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action merge autogpt2

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action test

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action please run

jmikedupont2 avatar Oct 06 '23 14:10 jmikedupont2

/agent-action run the jewels

jmikedupont2 avatar Oct 06 '23 15:10 jmikedupont2

/agent-action fork the repor

jmikedupont2 avatar Oct 06 '23 15:10 jmikedupont2

/agent-action fork the repo

jmikedupont2 avatar Oct 06 '23 15:10 jmikedupont2

/agent-action document the steps

jmikedupont2 avatar Oct 06 '23 16:10 jmikedupont2

/agent-action yoda

jmikedupont2 avatar Oct 06 '23 16:10 jmikedupont2

/agent-action mando

jmikedupont2 avatar Oct 06 '23 16:10 jmikedupont2

/agent-action try again

jmikedupont2 avatar Oct 06 '23 16:10 jmikedupont2

/agent-action batsignal

jmikedupont2 avatar Oct 06 '23 16:10 jmikedupont2

/agent-action batsignal

jmikedupont2 avatar Oct 06 '23 17:10 jmikedupont2

/agent-action batsy

jmikedupont2 avatar Oct 06 '23 17:10 jmikedupont2

/agent-action send bat signal

jmikedupont2 avatar Oct 06 '23 17:10 jmikedupont2

/agent-action send bat signal

jmikedupont2 avatar Oct 06 '23 17:10 jmikedupont2

/agent-action send bat signal , batman

jmikedupont2 avatar Oct 06 '23 18:10 jmikedupont2