Spaces:
Sleeping
Sleeping
bug fixes
Browse files- gemmademo/_chat.py +2 -3
gemmademo/_chat.py
CHANGED
|
@@ -43,8 +43,7 @@ class GradioChat:
|
|
| 43 |
def _load_task(self, task_name: str):
|
| 44 |
"""Loads the task dynamically when switching tasks."""
|
| 45 |
self.current_task_name = task_name
|
| 46 |
-
|
| 47 |
-
return
|
| 48 |
|
| 49 |
def _chat(self):
|
| 50 |
def chat_fn(message, history, selected_model, selected_task):
|
|
@@ -60,7 +59,7 @@ class GradioChat:
|
|
| 60 |
|
| 61 |
# Reload task if changed
|
| 62 |
if selected_task != self.current_task_name:
|
| 63 |
-
self._load_task(selected_task)
|
| 64 |
# Clear message history when task changes
|
| 65 |
if self.model:
|
| 66 |
self.model.messages = []
|
|
|
|
| 43 |
def _load_task(self, task_name: str):
|
| 44 |
"""Loads the task dynamically when switching tasks."""
|
| 45 |
self.current_task_name = task_name
|
| 46 |
+
return PromptManager(task=task_name)
|
|
|
|
| 47 |
|
| 48 |
def _chat(self):
|
| 49 |
def chat_fn(message, history, selected_model, selected_task):
|
|
|
|
| 59 |
|
| 60 |
# Reload task if changed
|
| 61 |
if selected_task != self.current_task_name:
|
| 62 |
+
self.prompt_manager = self._load_task(selected_task)
|
| 63 |
# Clear message history when task changes
|
| 64 |
if self.model:
|
| 65 |
self.model.messages = []
|