Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -112,7 +112,7 @@ def generate_explanation(issue_text, quality_name):
|
|
| 112 |
{"role": "system", "content": "You are an expert software engineering assistant specializing in software quality analysis."},
|
| 113 |
{"role": "user", "content": prompt}
|
| 114 |
],
|
| 115 |
-
max_completion_tokens=
|
| 116 |
temperature=0.9,
|
| 117 |
top_p=0.9
|
| 118 |
)
|
|
@@ -135,7 +135,7 @@ def run_classification_models(text):
|
|
| 135 |
probs = softmax(outputs.logits.cpu().numpy(), axis=1)
|
| 136 |
avg_prob = np.mean(probs[:, 1])
|
| 137 |
quality_name = get_quality_name(model_path)
|
| 138 |
-
if avg_prob >= 0.
|
| 139 |
results.append((quality_name, avg_prob))
|
| 140 |
return results
|
| 141 |
|
|
@@ -160,7 +160,7 @@ def main_interface(text):
|
|
| 160 |
|
| 161 |
if not results:
|
| 162 |
return (
|
| 163 |
-
gr.update(value="<p style='color:orange;'>No prediction above the 0.
|
| 164 |
gr.update(value=""),
|
| 165 |
gr.update(value="")
|
| 166 |
)
|
|
|
|
| 112 |
{"role": "system", "content": "You are an expert software engineering assistant specializing in software quality analysis."},
|
| 113 |
{"role": "user", "content": prompt}
|
| 114 |
],
|
| 115 |
+
max_completion_tokens=300,
|
| 116 |
temperature=0.9,
|
| 117 |
top_p=0.9
|
| 118 |
)
|
|
|
|
| 135 |
probs = softmax(outputs.logits.cpu().numpy(), axis=1)
|
| 136 |
avg_prob = np.mean(probs[:, 1])
|
| 137 |
quality_name = get_quality_name(model_path)
|
| 138 |
+
if avg_prob >= 0.80:
|
| 139 |
results.append((quality_name, avg_prob))
|
| 140 |
return results
|
| 141 |
|
|
|
|
| 160 |
|
| 161 |
if not results:
|
| 162 |
return (
|
| 163 |
+
gr.update(value="<p style='color:orange;'>No prediction above the 0.80 threshold, Try making the issue more descriptive and verbose.</p>"),
|
| 164 |
gr.update(value=""),
|
| 165 |
gr.update(value="")
|
| 166 |
)
|