DEADLOCK007X commited on
Commit
fc0d268
·
verified ·
1 Parent(s): 5900202

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -15
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 evaluate_interface(question, code):
7
- result = evaluate_code(question, code)
8
- stars = result.get("stars", 0)
9
- feedback = result.get("feedback", "No feedback provided.")
10
- return f"Stars: {stars}\nFeedback: {feedback}"
11
 
12
  iface = gr.Interface(
13
- fn=evaluate_interface,
14
  inputs=[
15
  gr.Textbox(lines=2, placeholder="Enter the problem question here..."),
16
- gr.Textbox(lines=10, placeholder="Enter your code solution here...")
17
  ],
18
- outputs="text",
19
- title="TinyLlama Code Evaluator",
20
- description="Evaluate your coding solution with TinyLlama. Provide the problem statement and your code to get a rating and feedback."
21
  )
22
 
23
- if __name__ == "__main__":
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()