EAV123 commited on
Commit
b650ca3
1 Parent(s): dfe3e5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -45,16 +45,18 @@ if upload_code_file is not None:
45
  code_image = Image.open(upload_code_file)
46
  st.image(code_image, caption="Uploaded Code Image", use_column_width=True)
47
 
48
- # Prompt Template for code interpretation
49
- input_prompt_code = """
50
- You are an expert in coding. The image contains a piece of code. Your task is to interpret the code and solve the problem it presents.
51
- Provide an analysis of the code, its functionality, and any potential improvements or solutions.
52
- """
53
-
54
- # Button for code interpretation
55
- submit = st.button("Interpret Code!")
56
- if submit:
57
- code_image_data = prep_image(upload_code_file)
58
- response = get_response_code(code_image_data, input_prompt_code)
59
- st.subheader("Code AI: ")
60
- st.write(response)
 
 
 
45
  code_image = Image.open(upload_code_file)
46
  st.image(code_image, caption="Uploaded Code Image", use_column_width=True)
47
 
48
+ # Prompt Template for code interpretation
49
+ input_prompt_code = """
50
+ You are an expert in coding. The image contains a piece of code. Your task is to interpret the code and solve the problem it presents.
51
+ Provide a complete solution of the code.
52
+ """
53
+
54
+ # Button for code interpretation
55
+ submit = st.button("Interpret Code!")
56
+ if submit:
57
+ code_image_data = prep_image(upload_code_file)
58
+ response = get_response_code(code_image_data, input_prompt_code)
59
+ st.subheader("Code AI: ")
60
+ st.write(response)
61
+ else:
62
+ st.info("Please upload an image of the code to proceed.")