قم بتقييم Openai GPT / Google Vertex AI Palm2 / Gemini أو نماذج Ollama المحلية مقابل مهمة.
توزيع المهام التعسفية على أنها YAML على نماذج اللغة المحلية أو المستضافة. في نموذج المهام الصياغة يتم تقسيمها بواسطة: الوكلاء ، والمعالجات الاختيارية ، والمقيمين . المهام لديها موجه المستوى الأعلى - العمل الفعلي للقيام به. على سبيل المثال ، يمكنك استخدام ما يلي كموجه مهمة: "تنفيذ مثال بسيط لـ malloc في C مع التوقيع التالي: void* malloc(size_t size) ". بعد ذلك ، يمكنك تضمين طلب ما بعد المعالج إلى نموذج محلي لاستخراج رمز مصدر البرنامج فقط من استجابة الوكيل. أخيرًا ، سيتم توجيه المقيِّم الخاص بك بالعمل كخبير في المهمة بشكل مثالي مع أمثلة COT (سلسلة الفكر) المدرجة.
.jsonpython src/main.py git clone https://github.com/Brandon7CC/MODELFORGE
cd MODELFORGE/
python -m venv forge-env
source forge-env/bin/activate
pip install -r requirements.txt
python src/main.py -h
echo " Done! Next, you can try FizzBuzz with Ollama locally!npython src/main.py task_configs/FizzBuzz.yaml FizzBuzz هو سؤال كلاسيكي "هل يمكنك رمز". الأمر بسيط ، ولكن يمكن أن يوفر مستوى من البصيرة حول كيفية تفكير المطور من خلال مشكلة ما. على سبيل المثال ، في Python ، استخدام تدفق التحكم ، lambdas ، إلخ. إليك بيان المشكلة:
اكتب برنامجًا لعرض الأرقام من 1 إلى ن. لمضاعفات ثلاثة ، طباعة "fizz" بدلاً من الرقم ، وللمضاعفات من خمسة ، طباعة "الطنانة". بالنسبة للأرقام التي هي مضاعفات من ثلاثة وخمسة ، طباعة "fizzbuzz".
بعد ذلك ، سنجعل ملف تكوين المهمة الخاص بنا (تم ذلك بالفعل من أجلك في task_configs/FizzBuzz.yaml ) ، لكننا سنمر بك. للقيام بذلك ، سنحدد مهمة المستوى الأعلى تسمى "FizzBuzz" ، واعطها موجهًا وعدد المرات التي نريد أن يحلها المشكلة.
tasks :
- name : FizzBuzz
# If a run count is not provided then the task will only run until evaluator success.
run_count : 5
prompt : |
Write a program to display numbers from 1 to n. For multiples of three, print "Fizz"
instead of the number, and for the multiples of five, print "Buzz". For numbers which
are multiples of both three and five, print "FizzBuzz".
Let's think step by step.الآن سنحدد "وكيلنا" - النموذج الذي سيعمل كخبير لإكمال مهمتنا. يمكن أن تكون النماذج من طرز Ollama المستضافة / المحلية المدعومة (مثل Gemini's Gemini ، أو Openai's GPT-4 ، أو Mixtral AI's Mixtral8x7b عبر Ollama).
tasks :
- name : FizzBuzz
run_count : 5
prompt : |
...
agent :
# We'll generate a custom model for each base model
base_model : mixtral:8x7b-instruct-v0.1-q4_1
temperature : 0.98
system_prompt : |
You're an expert Python developer. Follow these requirement **exactly**:
- The code you produce is at the principal level;
- You follow modern object oriented programming patterns;
- You list your requirements and design a simple test before implementing.
Review the user's request and follow these requirements.اختياريا يمكننا إنشاء "ما بعد المعالج" . سنريد فقط تقييم الرمز من قبل الوكيل ، لذا سنقوم هنا بتوصيل نموذج ما بعد المعالج من رمز المصدر من استجابة الوكيل.
tasks :
- name : FizzBuzz
# If a run count is not provided then the task will only run until evaluator success.
run_count : 5
prompt : |
...
agent :
# We'll generate a custom model for each base model
base_model : gpt-4-1106-preview
temperature : 0.98
system_prompt : |
...
postprocessor :
base_model : mistral
temperature : 0.1
system_prompt : |
You have one job: return the source code provided in the user's message.
**ONLY** return the exact source code. Your response is not read by a human.أخيرًا ، ستحتاج إلى نموذج "تقييم" يعمل كخبير في مراجعة الإخراج من الوكيل/Postprocessor. مهمة المقيِّم هي العودة الحقيقية / الخاطئة. بالإضافة إلى ذلك ، يمكننا أن نفشل حتى 10 مرات -إعادة الاستعداد للوكيل. هنا كان هناك القليل من السحر - سنقوم بتضمين ملخص موجز للمحاولة الفاشلة - نقدًا في الاستعلام التالي للوكيل. هذا يمكّن الوكيل من التكرار على نفسه بطريقة أكثر فاعلية . هنا نريد من المقيمين مراجعة تنفيذ FizzBuzz.
tasks :
- name : FizzBuzz
# If a run count is not provided then the task will only run until evaluator success.
run_count : 5
prompt : |
...
agent :
# We'll generate a custom model for each base model
base_model : codellama
temperature : 0.98
system_prompt : |
...
postprocessor :
base_model : gemini-pro
temperature : 0.1
system_prompt : |
...
# Evaluators have defined system prompts to only return true / false for their domain.
evaluator :
base_model : gpt-4-1106-preview
temperature : 0.1
system_prompt : |
Assess if a given sample program correctly implements Fizz Buzz.
The program should display numbers from 1 to n. For multiples of three, it should
print "Fizz" instead of the number, for the multiples of five, it should print "Buzz",
and for numbers which are multiples of both three and five, it should print "FizzBuzz".
Guidelines for Evaluation
- Correctness: Verify that the program outputs "Fizz" for multiples of 3, "Buzz" for
multiples of 5, and "FizzBuzz" for numbers that are multiples of both 3 and 5. For
all other numbers, it should output the number itself.
- Range Handling: Check if the program correctly handles the range from 1 to n, where
n is the upper limit provided as input.
- Error Handling: Assess if the program includes basic error handling, such as ensuring
the input is a positive integer.استلهم هذا العمل من نهج Funsearch الخاص بـ Google DeepMind لإيجاد حل جديد لمشكلة مجموعة CAP. على مستوى الماكرو ، تم ذلك عن طريق تطوير أمثلة قائمة على COT (سلسلة من الفكر) ، مما دفع مرارًا وتكرارًا إلى إنشاء كميات كبيرة من البرامج ، ثم تقييم تلك البرامج على عدة مستويات.