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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -1,24 +1,24 @@
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.inputs.Textbox(lines=2, placeholder="Enter the problem question here..."),
16
- gr.inputs.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
+ # 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()