Skip to content

Commit

Permalink
doc clearn up
Browse files Browse the repository at this point in the history
  • Loading branch information
liyin2015 committed Sep 14, 2024
1 parent 217bddb commit fafc6d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 57 deletions.
2 changes: 1 addition & 1 deletion adalflow/adalflow/eval/g_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,5 @@ def compute(
return final_output, output

def __str__(self) -> str:
s = f"llm_judge={self.llm_evaluator}, prompt_kwargs={self.llm_judge.prompt_kwargs}"
s = f"llm_judge={self.llm_judge}, prompt_kwargs={self.llm_judge.prompt_kwargs}"
return s
52 changes: 0 additions & 52 deletions adalflow/adalflow/optim/text_grad/tgd_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,58 +25,6 @@

log = logging.getLogger(__name__)

GLOSSARY_TEXT = r"""
### Glossary of tags that will be sent to you:
{# # - <LM_SYSTEM_PROMPT>: The system prompt for the language model.
# - <LM_INPUT>: The input to the language model.
# - <LM_OUTPUT>: The output of the language model. #}
# - <FEEDBACK>: The feedback to the variable.
# - <CONVERSATION>: The conversation history.
# - <FOCUS>: The focus of the optimization.
# - <ROLE>: The role description of the variable."""

# customize the system prompt
# prompts, solutions to problems, code, or any other text-based variable. -> to the variable type.
# The optimizer will have an understanding of different variable types.

# Tips:
# - DO NOT address concerns on the peer variables. The peer variables will be optimized separately.
# - The instruction needs to be on point, clear, and accurate.
# You can take the following actions:
# - You can delete words or phrases that you think are not necessary or you find misleading.
# - You can add new words or phrases that you think can address the feedback.
# - You can add sections like "Tips" or "Remember" to fix the issue.
# - You can be creative and write the variable in a different way.#}

# Think step by step. But keep the reasoning concise!!!
# Start response with "because" and "since" to provide reasoning.
# The last line of your response will be the new variable value put in between {{new_variable_start_tag}} and {{new_variable_end_tag}} tags.

# {#You are part of an optimization system that improves the exsiting variable value according to feedback.

# You will be asked to creatively and critically at proposing new variable value.
# The feedback may be noisy, focus on what is important.
# {# output format #}
# You MUST ONLY output the new variable value in the response between {{new_variable_start_tag}} and {{new_variable_end_tag}} tags.
# {% if instruction_to_optimizer %}
# USER INSTRUCTION: {{instruction_to_optimizer}}
# {% endif %}
# Remember:
# - Pay attention to role description, and most importantly, the feedback.
# - Must provide a different value that addresses the feedback.
# - If <HISTORY_PERFORMANCE> is provided, observe the patterns of the past iterations, pay close attention to high-performing value and aim to improve the variable value.
# - The new value better not overlap with the scope of peer variables.
# - Make your best judgment and be creative.
# TIPS:
# - Delete words or phrases that you think are not necessary or you find misleading.
# - Add new words or phrases that you think can address the feedback.
# - Add sections like "Tips" or "Remember" to fix the issue.
# - Be eative and write the variable in a different way.#}

# Your task: Propose a new variable value in response to the feedback.
# 1. Focus on what is essential, even if feedback is noisy.
# 2. Observe past performance patterns when provided and aim to improve upon high-performing values.
# 3. Avoid overlap with peer variables' scope.

# Tips:
# 1. Eliminate unnecessary words or phrases.
Expand Down
5 changes: 3 additions & 2 deletions adalflow/adalflow/optim/trainer/adal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@


class AdalComponent(Component):
"""Define a train, eval, and test step for a task pipeline.
__doc__ = """Define a train, eval, and test step for a task pipeline.
This serves the following purposes:
1. Organize all parts for training a task pipeline organized in one place.
1. Organize all parts for training a task pipeline in one place.
2. Help with debugging and testing before the actual training.
3. Adds multi-threading support for training and evaluation.
"""

task: Component
Expand Down
3 changes: 1 addition & 2 deletions adalflow/adalflow/optim/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


class Trainer(Component):
r"""We make trainer a component to as a trainer itself is an LLM task pipeline too.
__doc__ = r"""Ready to use trainer for LLM task pipeline to optimize all types of parameters.
Training set: can be used for passing initial proposed prompt or for few-shot sampling.
Expand Down Expand Up @@ -339,7 +339,6 @@ def fit(
)
self.adaltask.configure_teacher_generator()
print("Configured demo optimizers")
# return
else:
print("No trainable demo params to optimize")
self.demo_optimizers = []
Expand Down

0 comments on commit fafc6d8

Please sign in to comment.