Update app.py
Browse files
app.py
CHANGED
|
@@ -18,25 +18,36 @@ def classify_commit(message):
|
|
| 18 |
# Return the predicted labels as a comma-separated string
|
| 19 |
return ", ".join(predicted_labels[0]) if predicted_labels[0] else "No labels"
|
| 20 |
|
| 21 |
-
# Create a Gradio interface with
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=classify_commit,
|
| 24 |
inputs=gr.Textbox(
|
| 25 |
label="Enter Commit Message",
|
| 26 |
-
placeholder="Type your commit message here...",
|
| 27 |
lines=3,
|
| 28 |
max_lines=5,
|
| 29 |
),
|
| 30 |
outputs=gr.Textbox(label="Predicted Labels"),
|
| 31 |
-
title="
|
| 32 |
-
description="
|
| 33 |
examples=[
|
| 34 |
-
["Fixed
|
| 35 |
-
["Added a new
|
| 36 |
-
["Updated
|
| 37 |
-
["Refactored
|
|
|
|
| 38 |
],
|
| 39 |
theme="compact", # Optional: A compact Gradio theme
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
)
|
| 41 |
|
| 42 |
# Launch the Gradio app
|
|
|
|
| 18 |
# Return the predicted labels as a comma-separated string
|
| 19 |
return ", ".join(predicted_labels[0]) if predicted_labels[0] else "No labels"
|
| 20 |
|
| 21 |
+
# Create a Gradio interface with Dockerfile-specific examples and visuals
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=classify_commit,
|
| 24 |
inputs=gr.Textbox(
|
| 25 |
label="Enter Commit Message",
|
| 26 |
+
placeholder="Type your Dockerfile-related commit message here...",
|
| 27 |
lines=3,
|
| 28 |
max_lines=5,
|
| 29 |
),
|
| 30 |
outputs=gr.Textbox(label="Predicted Labels"),
|
| 31 |
+
title="🐳 Dockerfile Commit Message Classifier",
|
| 32 |
+
description="🔍 Classify commit messages related to Dockerfiles into categories like 'bug fix', 'feature addition', and more. Enter a commit message to get the predictions.",
|
| 33 |
examples=[
|
| 34 |
+
["Fixed an issue with the base image version in Dockerfile"],
|
| 35 |
+
["Added a new multistage build to optimize Docker image size"],
|
| 36 |
+
["Updated the Python version in Dockerfile to 3.10"],
|
| 37 |
+
["Refactored Dockerfile to reduce build time"],
|
| 38 |
+
["Added COPY instruction for configuration files"],
|
| 39 |
],
|
| 40 |
theme="compact", # Optional: A compact Gradio theme
|
| 41 |
+
article="""
|
| 42 |
+
**How to Use**:
|
| 43 |
+
- Enter a commit message related to Dockerfiles.
|
| 44 |
+
- The tool predicts categories such as 'bug fix', 'code refactoring', 'feature addition', or 'maintenance/other'.
|
| 45 |
+
|
| 46 |
+
**Examples**:
|
| 47 |
+
- Fixing base image versions.
|
| 48 |
+
- Adding new Docker build stages.
|
| 49 |
+
- Updating dependencies in Dockerfiles.
|
| 50 |
+
""",
|
| 51 |
)
|
| 52 |
|
| 53 |
# Launch the Gradio app
|