Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,15 +10,32 @@ headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
|
10 |
client = AsyncInferenceClient(api_url)
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
system_prompt = """
|
14 |
### Instruction:
|
15 |
Refactor the provided Python code to improve its maintainability and efficiency and reduce complexity. Include the refactored code along with the comments on the changes made for improving the metrics.
|
16 |
### Input:
|
17 |
|
18 |
-
"""
|
19 |
-
title = "Python Refactoring"
|
20 |
-
description = """
|
21 |
-
Please give it 4 to 5 minutes for the model to load and Run , consider using Python code with less than 120 lines of code due to GPU constrainst
|
22 |
"""
|
23 |
css = """.toast-wrap { display: none !important } """
|
24 |
examples=[ ["""
|
|
|
10 |
client = AsyncInferenceClient(api_url)
|
11 |
|
12 |
|
13 |
+
|
14 |
+
title = "Python Refactoring"
|
15 |
+
description = """
|
16 |
+
## Instructions for Using the Model
|
17 |
+
|
18 |
+
### Model Loading Time:
|
19 |
+
- Please allow 2 to 3 minutes for the model to load and run, especially on the first usage which might experience a "Cold Start."
|
20 |
+
|
21 |
+
### Code Submission:
|
22 |
+
- You can enter or paste your python code you wish to have refactored, or use the provided example.
|
23 |
+
|
24 |
+
### Python Code Constraints:
|
25 |
+
- When using this tool, keep the code under 120 lines due to GPU constraints.
|
26 |
+
|
27 |
+
### Understanding Changes:
|
28 |
+
- It's important to read the "Changes made" section at the end of the refactored code response. This will help in understanding what modifications have been made to enhance the maintainability and readability of the code.
|
29 |
+
|
30 |
+
### Usage Recommendation:
|
31 |
+
- Do not use this for personal projects; try it for research purposes only, as running these GPUs is costly.
|
32 |
+
|
33 |
+
"""
|
34 |
system_prompt = """
|
35 |
### Instruction:
|
36 |
Refactor the provided Python code to improve its maintainability and efficiency and reduce complexity. Include the refactored code along with the comments on the changes made for improving the metrics.
|
37 |
### Input:
|
38 |
|
|
|
|
|
|
|
|
|
39 |
"""
|
40 |
css = """.toast-wrap { display: none !important } """
|
41 |
examples=[ ["""
|