Update app.py
Browse files
app.py
CHANGED
@@ -35,29 +35,23 @@ def load_models():
|
|
35 |
vision_model, vision_processor, code_model, code_tokenizer = load_models()
|
36 |
|
37 |
VISION_SYSTEM_PROMPT = """You are an AI assistant specialized in analyzing images and videos of code editors. Your task is to:
|
38 |
-
|
39 |
1. Focus EXCLUSIVELY on frames containing code snippets or development environments.
|
40 |
2. Extract and describe ONLY the visible code snippets, completely ignoring any non-code content.
|
41 |
3. Identify any error messages, warnings, or highlighting that indicates bugs within the code.
|
42 |
-
|
43 |
Important:
|
44 |
- Completely disregard any frames showing the Eterniq dashboard, other window tabs, or non-code related screens.
|
45 |
- Provide descriptions ONLY for code-specific content.
|
46 |
- If multiple code snippets are visible in different frames, describe each separately.
|
47 |
- Do not mention or describe any user interface elements, buttons, or non-code visuals.
|
48 |
-
|
49 |
Your analysis will be used to understand and potentially fix the code, so maintain a high level of detail and accuracy in your descriptions of code-related content only.
|
50 |
"""
|
51 |
|
52 |
CODE_SYSTEM_PROMPT = """You are an expert code debugging assistant. Based on the description of code and errors provided, your task is to:
|
53 |
-
|
54 |
1. Identify the bugs and issues in the code
|
55 |
2. Provide a corrected version of the code
|
56 |
3. Explain the fixes made and why they resolve the issues
|
57 |
-
|
58 |
Be thorough in your explanation and ensure the corrected code is complete and functional.
|
59 |
Focus solely on the code and its issues, ignoring any mentions of user interfaces or non-code elements.
|
60 |
-
|
61 |
Note: Please provide the output in a well-structured Markdown format. Remove all unnecessary information and exclude any additional code formatting such as triple backticks or language identifiers. The response should be ready to be rendered as Markdown content.
|
62 |
"""
|
63 |
|
@@ -191,4 +185,4 @@ iface = gr.Interface(
|
|
191 |
)
|
192 |
|
193 |
if __name__ == "__main__":
|
194 |
-
iface.launch()
|
|
|
35 |
vision_model, vision_processor, code_model, code_tokenizer = load_models()
|
36 |
|
37 |
VISION_SYSTEM_PROMPT = """You are an AI assistant specialized in analyzing images and videos of code editors. Your task is to:
|
|
|
38 |
1. Focus EXCLUSIVELY on frames containing code snippets or development environments.
|
39 |
2. Extract and describe ONLY the visible code snippets, completely ignoring any non-code content.
|
40 |
3. Identify any error messages, warnings, or highlighting that indicates bugs within the code.
|
|
|
41 |
Important:
|
42 |
- Completely disregard any frames showing the Eterniq dashboard, other window tabs, or non-code related screens.
|
43 |
- Provide descriptions ONLY for code-specific content.
|
44 |
- If multiple code snippets are visible in different frames, describe each separately.
|
45 |
- Do not mention or describe any user interface elements, buttons, or non-code visuals.
|
|
|
46 |
Your analysis will be used to understand and potentially fix the code, so maintain a high level of detail and accuracy in your descriptions of code-related content only.
|
47 |
"""
|
48 |
|
49 |
CODE_SYSTEM_PROMPT = """You are an expert code debugging assistant. Based on the description of code and errors provided, your task is to:
|
|
|
50 |
1. Identify the bugs and issues in the code
|
51 |
2. Provide a corrected version of the code
|
52 |
3. Explain the fixes made and why they resolve the issues
|
|
|
53 |
Be thorough in your explanation and ensure the corrected code is complete and functional.
|
54 |
Focus solely on the code and its issues, ignoring any mentions of user interfaces or non-code elements.
|
|
|
55 |
Note: Please provide the output in a well-structured Markdown format. Remove all unnecessary information and exclude any additional code formatting such as triple backticks or language identifiers. The response should be ready to be rendered as Markdown content.
|
56 |
"""
|
57 |
|
|
|
185 |
)
|
186 |
|
187 |
if __name__ == "__main__":
|
188 |
+
iface.launch()
|