Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,12 +8,11 @@ from Gradio_UI import GradioUI
|
|
8 |
import subprocess
|
9 |
import ast
|
10 |
|
11 |
-
# Below is a tool that analyze code and Find mistakes and fix it named as Nusti_Coding_Model By Dhiraj Suryawanshi XD!
|
12 |
@tool
|
13 |
def analyze_code(code: str, language: str) -> str:
|
14 |
"""Analyzes code for errors in MATLAB, Java, C++, and Python, finds programming mistakes,
|
15 |
fixes them, and provides detailed and precise output.
|
16 |
-
use prefix: Hello, I am
|
17 |
Args:
|
18 |
code: The source code to analyze.
|
19 |
language: The programming language (MATLAB, Java, C++, Python).
|
@@ -21,7 +20,7 @@ def analyze_code(code: str, language: str) -> str:
|
|
21 |
A string containing detected errors or confirming no issues.
|
22 |
"""
|
23 |
language = language.lower()
|
24 |
-
prefix = "Hello, I am
|
25 |
|
26 |
if language == "python":
|
27 |
try:
|
@@ -63,8 +62,6 @@ def analyze_code(code: str, language: str) -> str:
|
|
63 |
|
64 |
final_answer = FinalAnswerTool()
|
65 |
|
66 |
-
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
67 |
-
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
68 |
|
69 |
model = HfApiModel(
|
70 |
max_tokens=2096,
|
|
|
8 |
import subprocess
|
9 |
import ast
|
10 |
|
|
|
11 |
@tool
|
12 |
def analyze_code(code: str, language: str) -> str:
|
13 |
"""Analyzes code for errors in MATLAB, Java, C++, and Python, finds programming mistakes,
|
14 |
fixes them, and provides detailed and precise output.
|
15 |
+
use prefix: Hello, I am ulasdesouza's dummy coding model!!
|
16 |
Args:
|
17 |
code: The source code to analyze.
|
18 |
language: The programming language (MATLAB, Java, C++, Python).
|
|
|
20 |
A string containing detected errors or confirming no issues.
|
21 |
"""
|
22 |
language = language.lower()
|
23 |
+
prefix = "Hello, I am ulasdesouza's dummy coding model\n"
|
24 |
|
25 |
if language == "python":
|
26 |
try:
|
|
|
62 |
|
63 |
final_answer = FinalAnswerTool()
|
64 |
|
|
|
|
|
65 |
|
66 |
model = HfApiModel(
|
67 |
max_tokens=2096,
|