Spaces:
Build error
Build error
Update Gradio_UI.py
Browse files- Gradio_UI.py +11 -11
Gradio_UI.py
CHANGED
|
@@ -207,22 +207,22 @@ class GradioUI:
|
|
| 207 |
if not os.path.exists(file_upload_folder):
|
| 208 |
os.mkdir(file_upload_folder)
|
| 209 |
|
| 210 |
-
def gradio_search_jokes(self, word): # Теперь это МЕТОД класса
|
| 211 |
-
|
| 212 |
-
|
| 213 |
|
| 214 |
-
|
| 215 |
|
| 216 |
-
|
| 217 |
|
| 218 |
-
|
| 219 |
-
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
|
| 225 |
-
|
| 226 |
|
| 227 |
|
| 228 |
def interact_with_agent(self, prompt, messages):
|
|
|
|
| 207 |
if not os.path.exists(file_upload_folder):
|
| 208 |
os.mkdir(file_upload_folder)
|
| 209 |
|
| 210 |
+
# def gradio_search_jokes(self, word): # Теперь это МЕТОД класса
|
| 211 |
+
# """Wrapper function that sends the request to the agent and retrieves the joke and its audio."""
|
| 212 |
+
# print(f"[DEBUG] Запрос к агенту: {word}") # Отладочный вывод перед вызовом агента
|
| 213 |
|
| 214 |
+
# response = self.agent.run(f"Find a dad joke that contains the word: {word}") # Запрашиваем у агента шутку
|
| 215 |
|
| 216 |
+
# print("[DEBUG] Агент вернул ответ:", response) # Проверяем, что агент вообще что-то вернул
|
| 217 |
|
| 218 |
+
# response_text = str(response) # Приводим объект к строке # Получаем текст ответа
|
| 219 |
+
# print("[DEBUG] Текст ответа:", response_text) # Проверяем, что текст есть
|
| 220 |
|
| 221 |
+
# # Генерируем аудио
|
| 222 |
+
# audio_file = speak_text(response_text)
|
| 223 |
+
# print("[DEBUG] Аудиофайл создан:", audio_file) # Проверяем, что аудиофайл сгенерировался
|
| 224 |
|
| 225 |
+
# return response_text, audio_file
|
| 226 |
|
| 227 |
|
| 228 |
def interact_with_agent(self, prompt, messages):
|