Change default model from MODEL_1 to MODEL_0 to match stable config
Respects existing stable configuration where: - MODEL_0 = Hermes (default for classification and feedback) - MODEL_1 = Qwen (for code generation) - MODEL_2 = GPT Updated: - All function defaults in activity.py: MODEL_1 -> MODEL_0 - activity37: Uses MODEL_0 for classification, MODEL_1 for code feedback This works with the existing environment variable setup without requiring changes to vars.sh.
This commit is contained in:
parent
8cebcbf118
commit
3c3b8bd493
2 changed files with 19 additions and 31 deletions
30
activity.py
30
activity.py
|
|
@ -91,7 +91,7 @@ def get_activity_content(file_path):
|
|||
|
||||
|
||||
def loop_through_steps_until_question(
|
||||
activity_content, activity_state, room_name, username, classifier_model="MODEL_1", feedback_model="MODEL_1"
|
||||
activity_content, activity_state, room_name, username, classifier_model="MODEL_0", feedback_model="MODEL_0"
|
||||
):
|
||||
room = get_room(room_name)
|
||||
|
||||
|
|
@ -223,9 +223,9 @@ def start_activity(room_name, s3_file_path, username):
|
|||
db.session.commit()
|
||||
|
||||
# Get model configuration from activity content if specified
|
||||
# Default to MODEL_1 (Hermes) for both - fast, accurate, and always available
|
||||
classifier_model = activity_content.get("classifier_model", "MODEL_1")
|
||||
feedback_model = activity_content.get("feedback_model", "MODEL_1")
|
||||
# Default to MODEL_0 (Hermes) for both - fast, accurate, and always available
|
||||
classifier_model = activity_content.get("classifier_model", "MODEL_0")
|
||||
feedback_model = activity_content.get("feedback_model", "MODEL_0")
|
||||
|
||||
# Loop through steps until a question is found or the end is reached
|
||||
loop_through_steps_until_question(
|
||||
|
|
@ -335,7 +335,7 @@ def execute_processing_script(metadata, script):
|
|||
return local_env["script_result"]
|
||||
|
||||
|
||||
def handle_activity_response(room_name, user_response, username, model="MODEL_1"):
|
||||
def handle_activity_response(room_name, user_response, username, model="MODEL_0"):
|
||||
with app.app_context():
|
||||
room = get_room(room_name)
|
||||
activity_state = ActivityState.query.filter_by(room_id=room.id).first()
|
||||
|
|
@ -347,9 +347,9 @@ def handle_activity_response(room_name, user_response, username, model="MODEL_1"
|
|||
activity_content = get_activity_content(activity_state.s3_file_path)
|
||||
|
||||
# Get activity-level model defaults
|
||||
# Default to MODEL_1 (Hermes) for both - fast, accurate, and always available
|
||||
default_classifier_model = activity_content.get("classifier_model", "MODEL_1")
|
||||
default_feedback_model = activity_content.get("feedback_model", "MODEL_1")
|
||||
# Default to MODEL_0 (Hermes) for both - fast, accurate, and always available
|
||||
default_classifier_model = activity_content.get("classifier_model", "MODEL_0")
|
||||
default_feedback_model = activity_content.get("feedback_model", "MODEL_0")
|
||||
|
||||
try:
|
||||
# Find the current section and step
|
||||
|
|
@ -921,7 +921,7 @@ def handle_activity_response(room_name, user_response, username, model="MODEL_1"
|
|||
)
|
||||
|
||||
|
||||
def display_activity_info(room_name, username, model="MODEL_1"):
|
||||
def display_activity_info(room_name, username, model="MODEL_0"):
|
||||
with app.app_context():
|
||||
room = get_room(room_name)
|
||||
activity_state = ActivityState.query.filter_by(room_id=room.id).first()
|
||||
|
|
@ -1009,7 +1009,7 @@ def display_activity_info(room_name, username, model="MODEL_1"):
|
|||
print(f"Exception: {e}")
|
||||
|
||||
|
||||
def generate_grading(chat_history, rubric, model="MODEL_1"):
|
||||
def generate_grading(chat_history, rubric, model="MODEL_0"):
|
||||
# Use provided model or fall back to default
|
||||
if model and model != "None":
|
||||
openai_client, model_name = get_openai_client_and_model(model)
|
||||
|
|
@ -1061,7 +1061,7 @@ def get_next_step(activity_content, current_section_id, current_step_id):
|
|||
|
||||
|
||||
# Categorize the user's response.
|
||||
def categorize_response(question, response, buckets, tokens_for_ai, model="MODEL_1"):
|
||||
def categorize_response(question, response, buckets, tokens_for_ai, model="MODEL_0"):
|
||||
# Use provided model or fall back to default
|
||||
if model and model != "None":
|
||||
openai_client, model_name = get_openai_client_and_model(model)
|
||||
|
|
@ -1142,7 +1142,7 @@ def generate_ai_feedback(
|
|||
username,
|
||||
json_metadata,
|
||||
json_new_metadata,
|
||||
model="MODEL_1",
|
||||
model="MODEL_0",
|
||||
):
|
||||
# Use provided model or fall back to default
|
||||
if model and model != "None":
|
||||
|
|
@ -1180,7 +1180,7 @@ def provide_feedback(
|
|||
username,
|
||||
json_metadata,
|
||||
json_new_metadata,
|
||||
model="MODEL_1",
|
||||
model="MODEL_0",
|
||||
):
|
||||
feedback = ""
|
||||
if "ai_feedback" in transition:
|
||||
|
|
@ -1211,7 +1211,7 @@ def provide_feedback_prompts(
|
|||
json_metadata,
|
||||
json_new_metadata,
|
||||
legacy_tokens_for_ai="",
|
||||
model="MODEL_1",
|
||||
model="MODEL_0",
|
||||
):
|
||||
"""Generate feedback from multiple prompts"""
|
||||
feedback_messages = []
|
||||
|
|
@ -1331,7 +1331,7 @@ def provide_feedback_prompts(
|
|||
return feedback_messages
|
||||
|
||||
|
||||
def translate_text(text, target_language, model="MODEL_1"):
|
||||
def translate_text(text, target_language, model="MODEL_0"):
|
||||
# Guard clause for default language
|
||||
target_language = target_language.lower().split()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,25 +2,13 @@ default_max_attempts_per_step: 3
|
|||
|
||||
# Model configuration
|
||||
# classifier_model: Fast classification into buckets (correct, partial, etc.)
|
||||
# MODEL_1 = Hermes-3-Llama-3.1-8B (always available, great for role-play)
|
||||
# MODEL_0 = Hermes (your stable default)
|
||||
#
|
||||
# feedback_model: Code generation and feedback
|
||||
# MODEL_3 = Qwen3-Coder-30B-A3B-Instruct (specialized for code)
|
||||
# Recommended: hf.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M
|
||||
# MODEL_1 = Qwen (specialized for code in your setup)
|
||||
#
|
||||
# Setup with llama.cpp:
|
||||
# 1. Download: huggingface-cli download unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF \
|
||||
# Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf
|
||||
# 2. Run: llama-server -m Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf \
|
||||
# --host 0.0.0.0 --port 8080 -ngl 99
|
||||
# 3. Set env: export MODEL_ENDPOINT_3=http://localhost:8080/v1
|
||||
# export MODEL_API_KEY_3=dummy
|
||||
#
|
||||
# Or use with ollama:
|
||||
# ollama run unsloth/qwen3-coder:30b-instruct-q4_K_M
|
||||
#
|
||||
classifier_model: "MODEL_1"
|
||||
feedback_model: "MODEL_3"
|
||||
classifier_model: "MODEL_0"
|
||||
feedback_model: "MODEL_1"
|
||||
|
||||
tokens_for_ai_rubric: |
|
||||
Evaluate the student's understanding of programming concepts in their chosen language.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue