Update app.py
Browse files
app.py
CHANGED
@@ -24,15 +24,10 @@ def analyze_and_fix_shell_script(script_content):
|
|
24 |
|
25 |
# Gradio interface to upload shell script and process
|
26 |
def upload_and_fix(file):
|
27 |
-
#
|
28 |
-
if isinstance(file,
|
29 |
-
# Decode the content if it's in byte/string format
|
30 |
-
script_content = file.decode("utf-8")
|
31 |
-
else:
|
32 |
-
# Otherwise, it's already a string
|
33 |
-
script_content = file
|
34 |
|
35 |
-
#
|
36 |
fixed_script = analyze_and_fix_shell_script(script_content)
|
37 |
|
38 |
return fixed_script
|
|
|
24 |
|
25 |
# Gradio interface to upload shell script and process
|
26 |
def upload_and_fix(file):
|
27 |
+
# Handle both string and byte file formats
|
28 |
+
script_content = file if isinstance(file, str) else file.decode("utf-8")
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
# Call the GPT model to analyze and fix the shell script
|
31 |
fixed_script = analyze_and_fix_shell_script(script_content)
|
32 |
|
33 |
return fixed_script
|