Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -640,7 +640,7 @@ Example responses:
|
|
640 |
|
641 |
context_section = "\n\n".join(context_sections) if context_sections else ""
|
642 |
|
643 |
-
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
644 |
YOUR ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
645 |
If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
|
646 |
If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
@@ -706,7 +706,7 @@ Answer:"""
|
|
706 |
|
707 |
full_context = "\n\n".join(context_sections)
|
708 |
|
709 |
-
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
710 |
Based on the search results and the context sections below, provide an answer to the question.
|
711 |
If the search results don't fully answer the question, you can supplement with information from other context sections or your general knowledge.
|
712 |
Your ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
@@ -1104,25 +1104,6 @@ def clear_cache():
|
|
1104 |
processing_status = {"is_processing": False, "progress": 0, "total": 0}
|
1105 |
return "Cache cleared successfully.", None
|
1106 |
|
1107 |
-
def test_media_processing(image_files, audio_files, question):
|
1108 |
-
"""
|
1109 |
-
Test the media processing functionality with uploaded files.
|
1110 |
-
"""
|
1111 |
-
if not question:
|
1112 |
-
question = "What can you tell me about the uploaded media?"
|
1113 |
-
|
1114 |
-
agent = IntelligentAgent(debug=True)
|
1115 |
-
|
1116 |
-
# Convert file paths to lists
|
1117 |
-
image_paths = [img.name for img in image_files] if image_files else None
|
1118 |
-
audio_paths = [aud.name for aud in audio_files] if audio_files else None
|
1119 |
-
|
1120 |
-
try:
|
1121 |
-
result = agent(question, image_files=image_paths, audio_files=audio_paths)
|
1122 |
-
return result
|
1123 |
-
except Exception as e:
|
1124 |
-
return f"Error processing media: {e}"
|
1125 |
-
|
1126 |
# --- Enhanced Gradio Interface ---
|
1127 |
with gr.Blocks(title="Intelligent Agent with Media Processing") as demo:
|
1128 |
gr.Markdown("# Intelligent Agent with Conditional Search and Media Processing")
|
|
|
640 |
|
641 |
context_section = "\n\n".join(context_sections) if context_sections else ""
|
642 |
|
643 |
+
answer_prompt = f"""\no_think You are a general AI assistant. I will ask you a question.
|
644 |
YOUR ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
645 |
If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
|
646 |
If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
|
|
706 |
|
707 |
full_context = "\n\n".join(context_sections)
|
708 |
|
709 |
+
answer_prompt = f"""\no_think You are a general AI assistant. I will ask you a question.
|
710 |
Based on the search results and the context sections below, provide an answer to the question.
|
711 |
If the search results don't fully answer the question, you can supplement with information from other context sections or your general knowledge.
|
712 |
Your ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
|
|
1104 |
processing_status = {"is_processing": False, "progress": 0, "total": 0}
|
1105 |
return "Cache cleared successfully.", None
|
1106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1107 |
# --- Enhanced Gradio Interface ---
|
1108 |
with gr.Blocks(title="Intelligent Agent with Media Processing") as demo:
|
1109 |
gr.Markdown("# Intelligent Agent with Conditional Search and Media Processing")
|