Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -490,33 +490,25 @@ def transcribe_function(stream, new_chunk):
|
|
490 |
return stream, full_text, result
|
491 |
|
492 |
|
493 |
-
|
494 |
-
|
495 |
-
# return ""
|
496 |
-
# response = history[-1][1]
|
497 |
-
# addresses = extract_addresses(response)
|
498 |
-
# return generate_map(addresses)
|
499 |
-
|
500 |
-
def update_map_with_response(history, addresses):
|
501 |
-
if not addresses:
|
502 |
return ""
|
|
|
|
|
503 |
return generate_map(addresses)
|
504 |
|
|
|
|
|
505 |
def clear_textbox():
|
506 |
return ""
|
507 |
|
508 |
-
|
509 |
-
# if choice in ["Details", "Conversational"]:
|
510 |
-
# return gr.update(visible=True), update_map_with_response(history)
|
511 |
-
# else:
|
512 |
-
# return gr.update(visible(False), "")
|
513 |
-
|
514 |
-
def show_map_if_details(history, choice):
|
515 |
if choice in ["Details", "Conversational"]:
|
516 |
-
|
517 |
-
return gr.update(visible=True), map_html
|
518 |
else:
|
519 |
-
return gr.update(visible
|
|
|
|
|
520 |
|
521 |
def generate_audio_elevenlabs(text):
|
522 |
XI_API_KEY = os.environ['ELEVENLABS_API']
|
|
|
490 |
return stream, full_text, result
|
491 |
|
492 |
|
493 |
+
def update_map_with_response(history):
|
494 |
+
if not history:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
return ""
|
496 |
+
response = history[-1][1]
|
497 |
+
addresses = extract_addresses(response)
|
498 |
return generate_map(addresses)
|
499 |
|
500 |
+
|
501 |
+
|
502 |
def clear_textbox():
|
503 |
return ""
|
504 |
|
505 |
+
def show_map_if_details(history,choice):
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
if choice in ["Details", "Conversational"]:
|
507 |
+
return gr.update(visible=True), update_map_with_response(history)
|
|
|
508 |
else:
|
509 |
+
return gr.update(visible(False), "")
|
510 |
+
|
511 |
+
|
512 |
|
513 |
def generate_audio_elevenlabs(text):
|
514 |
XI_API_KEY = os.environ['ELEVENLABS_API']
|