Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -177,6 +177,15 @@ def create_deepseek_interface():
|
|
177 |
f"- **Search Term**: {search_query}\n" + \
|
178 |
f"- **Parameters**: {params}\n"
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
# Function to call DeepSeek API with streaming
|
181 |
def query_deepseek_streaming(message, history, use_deep_research):
|
182 |
print(f"\n=== Starting query_deepseek_streaming ===")
|
@@ -355,14 +364,7 @@ When citing search results, mention the source, and ensure your answer reflects
|
|
355 |
new_history[-1]["content"] = search_info + error_msg
|
356 |
yield new_history, error_msg
|
357 |
|
358 |
-
#
|
359 |
-
def test_simple_response(message, history):
|
360 |
-
"""Simple test function to verify UI is working"""
|
361 |
-
print(f"Test function called with message: {message}")
|
362 |
-
# Convert to messages format
|
363 |
-
new_message = {"role": "user", "content": message}
|
364 |
-
response = {"role": "assistant", "content": f"Echo: {message}"}
|
365 |
-
return history + [new_message, response], ""
|
366 |
with gr.Blocks(theme="soft", fill_height=True) as demo:
|
367 |
# Header section
|
368 |
gr.Markdown(
|
@@ -383,7 +385,6 @@ When citing search results, mention the source, and ensure your answer reflects
|
|
383 |
container=True,
|
384 |
type="messages" # Explicitly set to messages format
|
385 |
)
|
386 |
-
)
|
387 |
|
388 |
# Add Deep Research toggle and status display
|
389 |
with gr.Row():
|
|
|
177 |
f"- **Search Term**: {search_query}\n" + \
|
178 |
f"- **Parameters**: {params}\n"
|
179 |
|
180 |
+
# Test function without streaming
|
181 |
+
def test_simple_response(message, history):
|
182 |
+
"""Simple test function to verify UI is working"""
|
183 |
+
print(f"Test function called with message: {message}")
|
184 |
+
# Convert to messages format
|
185 |
+
new_message = {"role": "user", "content": message}
|
186 |
+
response = {"role": "assistant", "content": f"Echo: {message}"}
|
187 |
+
return history + [new_message, response], ""
|
188 |
+
|
189 |
# Function to call DeepSeek API with streaming
|
190 |
def query_deepseek_streaming(message, history, use_deep_research):
|
191 |
print(f"\n=== Starting query_deepseek_streaming ===")
|
|
|
364 |
new_history[-1]["content"] = search_info + error_msg
|
365 |
yield new_history, error_msg
|
366 |
|
367 |
+
# Create Gradio interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
with gr.Blocks(theme="soft", fill_height=True) as demo:
|
369 |
# Header section
|
370 |
gr.Markdown(
|
|
|
385 |
container=True,
|
386 |
type="messages" # Explicitly set to messages format
|
387 |
)
|
|
|
388 |
|
389 |
# Add Deep Research toggle and status display
|
390 |
with gr.Row():
|