Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,18 @@
|
|
1 |
-
# CODEXGAME/backend/ai_evaluator/app.py
|
2 |
-
|
3 |
import gradio as gr
|
4 |
-
from tinyllama_inference import evaluate_code
|
5 |
|
6 |
-
def
|
7 |
-
|
8 |
-
|
9 |
-
feedback = result.get("feedback", "No feedback provided.")
|
10 |
-
return f"Stars: {stars}\nFeedback: {feedback}"
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
-
fn=
|
14 |
inputs=[
|
15 |
gr.Textbox(lines=2, placeholder="Enter the problem question here..."),
|
16 |
-
gr.
|
17 |
],
|
18 |
-
outputs="
|
19 |
-
title="
|
20 |
-
description="
|
21 |
)
|
22 |
|
23 |
-
|
24 |
-
iface.launch()
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
def evaluate_code(question, code):
|
4 |
+
# Dummy response (Replace with TinyLlama AI evaluation)
|
5 |
+
return "This code is correct and follows best practices."
|
|
|
|
|
6 |
|
7 |
iface = gr.Interface(
|
8 |
+
fn=evaluate_code,
|
9 |
inputs=[
|
10 |
gr.Textbox(lines=2, placeholder="Enter the problem question here..."),
|
11 |
+
gr.Code(language="python", placeholder="Write your code here...")
|
12 |
],
|
13 |
+
outputs=gr.Textbox(label="Evaluation Result"),
|
14 |
+
title="Code Evaluator",
|
15 |
+
description="Enter a coding question and your solution to get AI-powered feedback."
|
16 |
)
|
17 |
|
18 |
+
iface.launch()
|
|