Spaces:
Running
Running
Update model name for nopolicy in app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,8 @@ def analyze_code(code: str, language: str, model: str) -> str:
|
|
| 42 |
cwe_type = result.get("result", {}).get("cweType", "N/A")
|
| 43 |
model_used = result.get("result", {}).get("model", model)
|
| 44 |
explanation = result.get("result", {}).get("response", "")
|
| 45 |
-
|
|
|
|
| 46 |
if "nopolicy" in model_used:
|
| 47 |
model_used = "VirtueGuard Code"
|
| 48 |
if status == "yes":
|
|
|
|
| 42 |
cwe_type = result.get("result", {}).get("cweType", "N/A")
|
| 43 |
model_used = result.get("result", {}).get("model", model)
|
| 44 |
explanation = result.get("result", {}).get("response", "")
|
| 45 |
+
if "## Final Answer" in explanation:
|
| 46 |
+
explanation = explanation.split("## Final Answer")[0].strip()
|
| 47 |
if "nopolicy" in model_used:
|
| 48 |
model_used = "VirtueGuard Code"
|
| 49 |
if status == "yes":
|