Spaces:
Sleeping
Sleeping
# CODEXGAME/backend/ai_evaluator/app.py | |
import gradio as gr | |
from tinyllama_inference import evaluate_code | |
def evaluate_interface(question, code): | |
result = evaluate_code(question, code) | |
stars = result.get("stars", 0) | |
feedback = result.get("feedback", "No feedback provided.") | |
return f"Stars: {stars}\nFeedback: {feedback}" | |
iface = gr.Interface( | |
fn=evaluate_interface, | |
inputs=[ | |
gr.inputs.Textbox(lines=2, placeholder="Enter the problem question here..."), | |
gr.inputs.Textbox(lines=10, placeholder="Enter your code solution here...") | |
], | |
outputs="text", | |
title="TinyLlama Code Evaluator", | |
description="Evaluate your coding solution with TinyLlama. Provide the problem statement and your code to get a rating and feedback." | |
) | |
if __name__ == "__main__": | |
iface.launch() | |