Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using trained data #1642

Open
danielmeloalencar opened this issue Nov 23, 2024 · 2 comments
Open

Using trained data #1642

danielmeloalencar opened this issue Nov 23, 2024 · 2 comments
Labels
feature-request New feature or request

Comments

@danielmeloalencar
Copy link

Feature Area

Documentation

Is your feature request related to a an existing bug? Please link it here.

N/A

Describe the solution you'd like

N/A

Describe alternatives you've considered

I created this training script according to the documentation, but I don't know how to use the trained data after training. I think it's important to add something about this in the documentation.

Additional context

How to use trained data???

from crewai import Agent, Task, Crew, Process, LLM


olllama = LLM(
  model="ollama/qwen2.5-coder:latest",
  base_url="http://localhost:11434",
)

agente_escritor = Agent(
  role='Escritor de Cartas de Amor',
  goal='Escreva uma carta de amor para {nome_destinatario}, expressando os seguintes sentimentos: {sentimentos}. Assine como {meu_nome}',
  verbose=True,
  memory=True,
  llm=olllama,
  backstory='Você é um poeta experiente, '
            'conhecido por sua habilidade de expressar sentimentos '
            'profundos em palavras'
)

tarefa_escrita_carta = Task(
  description='Escrever uma carta de amor',
  expected_output='Carta de amor escrita com palavras sinceras e sentimentos profundos em português do Brasil', 
  agent=agente_escritor,
  output_file='carta_de_amor.txt'
)

equipe = Crew(
  agents=[agente_escritor],
  tasks=[tarefa_escrita_carta],
  process = Process.sequential
)

nome_destinatario = "Maria"
meu_nome = "João"
sentimentos = "amor, paixão, admiração"

inputs={'nome_destinatario':nome_destinatario, 'sentimentos':sentimentos, 'meu_nome':meu_nome}

n_iterations = 1
filename = "your_model.pkl"

try:
    equipe.train(
      n_iterations=n_iterations, 
      inputs=inputs, 
      filename=filename
    )

except Exception as e:
    raise Exception(f"An error occurred while training the crew: {e}")

Willingness to Contribute

No, I'm just suggesting the idea

@danielmeloalencar danielmeloalencar added the feature-request New feature or request label Nov 23, 2024
@theCyberTech
Copy link
Collaborator

It's automatically use it on the next run

@danielmeloalencar
Copy link
Author

So it didn't work for me.
Training programmatically doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants