Reboot Agents (#30387)
* Create CodeAgent and ReactAgent * Fix formatting errors * Update documentation for agents * Add custom errors, improve logging * Support variable usage in ReactAgent * add messages * Add message passing format * Create React Code Agent * Update * Refactoring * Fix errors * Improve python interpreter * Only non-tensor inputs should be sent to device * Calculator tool slight refactor * Improve docstrings * Refactor * Fix tests * Fix more tests * Fix even more tests * Fix tests by replacing output and input types * Fix operand type issue * two small fixes * EM TTS * Fix agent running type errors * Change text to speech tests to allow changed outputs * Update doc with new agent types * Improve code interpreter * If max iterations reached, provide a real answer instead of an error * Add edge case in interpreter * Add safe imports to the interpreter * Interpreter tweaks: tuples and listcomp * Make style * Make quality * Add dictcomp to interpreter * Rename ReactJSONAgent to ReactJsonAgent * Misc changes * ToolCollection * Rename agent's logger to self.logger * Add while loops to interpreter * Update doc with new tools. still need to mention collections * Add collections to the doc * Small fixes on logs and interpretor * Fix toolbox return type * Docs + fixup * Skip doctests * Correct prompts with improved examples and formatting * Update prompt * Remove outdated docs * Change agent to accept Toolbox object for tools * Remove calculator tool * Propagate removal of calculator in doc * Fix 2 failing workflows * Simplify additional argument passing * AgentType audio * Minor changes: function name, types * Remove calculator tests * Fix test * Fix torch requirement * Fix final answer tests * Style fixes * Fix tests * Update docstrings with calculator removal * Small type hint fixes * Update tests/agents/test_translation.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update tests/agents/test_python_interpreter.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/default_tools.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/tools.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update tests/agents/test_agents.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/models/bert/configuration_bert.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/tools.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/speech_to_text.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update tests/agents/test_speech_to_text.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update tests/agents/test_tools_common.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * pygments * Answer comments * Cleaning up * Simplifying init for all agents * Improving prompts and making code nicer * Style fixes * Add multiple comparator test in interpreter * Style fixes * Improve BERT example in documentation * Add examples to doc * Fix python interpreter quality * Logging improvements * Change test flag to agents * Quality fix * Add example for HfEngine * Improve conversation example for HfEngine * typo fix * Verify doc * Update docs/source/en/agents.md Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/agents.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/prompts.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/agents/python_interpreter.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update docs/source/en/agents.md Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Fix style issues * local s2t tool --------- Co-authored-by: Cyril Kondratenko <kkn1993@gmail.com> Co-authored-by: Lysandre <lysandre@huggingface.co> Co-authored-by: Lysandre <lysandre.debut@reseau.eseo.fr> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,8 @@ docs/source/en/_config.py
|
||||
docs/source/en/accelerate.md
|
||||
docs/source/en/add_new_model.md
|
||||
docs/source/en/add_new_pipeline.md
|
||||
docs/source/en/agents.md
|
||||
docs/source/en/agents.md
|
||||
docs/source/en/attention.md
|
||||
docs/source/en/benchmarks.md
|
||||
docs/source/en/bertology.md
|
||||
@@ -10,7 +12,6 @@ docs/source/en/community.md
|
||||
docs/source/en/contributing.md
|
||||
docs/source/en/create_a_model.md
|
||||
docs/source/en/custom_models.md
|
||||
docs/source/en/custom_tools.md
|
||||
docs/source/en/debugging.md
|
||||
docs/source/en/fast_tokenizers.md
|
||||
docs/source/en/glossary.md
|
||||
@@ -324,10 +325,20 @@ docs/source/en/tflite.md
|
||||
docs/source/en/tokenizer_summary.md
|
||||
docs/source/en/torchscript.md
|
||||
docs/source/en/training.md
|
||||
docs/source/en/transformers_agents.md
|
||||
docs/source/en/troubleshooting.md
|
||||
src/transformers/activations.py
|
||||
src/transformers/activations_tf.py
|
||||
src/transformers/agents/agent_types.py
|
||||
src/transformers/agents/agents.py
|
||||
src/transformers/agents/document_question_answering.py
|
||||
src/transformers/agents/evaluate_agent.py
|
||||
src/transformers/agents/image_question_answering.py
|
||||
src/transformers/agents/prompts.py
|
||||
src/transformers/agents/python_interpreter.py
|
||||
src/transformers/agents/speech_to_text.py
|
||||
src/transformers/agents/text_to_speech.py
|
||||
src/transformers/agents/tools.py
|
||||
src/transformers/agents/translation.py
|
||||
src/transformers/audio_utils.py
|
||||
src/transformers/benchmark/benchmark.py
|
||||
src/transformers/benchmark/benchmark_args.py
|
||||
@@ -974,22 +985,6 @@ src/transformers/time_series_utils.py
|
||||
src/transformers/tokenization_utils.py
|
||||
src/transformers/tokenization_utils_base.py
|
||||
src/transformers/tokenization_utils_fast.py
|
||||
src/transformers/tools/agent_types.py
|
||||
src/transformers/tools/agents.py
|
||||
src/transformers/tools/base.py
|
||||
src/transformers/tools/document_question_answering.py
|
||||
src/transformers/tools/evaluate_agent.py
|
||||
src/transformers/tools/image_captioning.py
|
||||
src/transformers/tools/image_question_answering.py
|
||||
src/transformers/tools/image_segmentation.py
|
||||
src/transformers/tools/prompts.py
|
||||
src/transformers/tools/python_interpreter.py
|
||||
src/transformers/tools/speech_to_text.py
|
||||
src/transformers/tools/text_classification.py
|
||||
src/transformers/tools/text_question_answering.py
|
||||
src/transformers/tools/text_summarization.py
|
||||
src/transformers/tools/text_to_speech.py
|
||||
src/transformers/tools/translation.py
|
||||
src/transformers/trainer.py
|
||||
src/transformers/trainer_callback.py
|
||||
src/transformers/trainer_pt_utils.py
|
||||
|
||||
Reference in New Issue
Block a user