Pijush2023 commited on
Commit
a0658e4
·
verified ·
1 Parent(s): 12acd01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -19
app.py CHANGED
@@ -490,33 +490,25 @@ def transcribe_function(stream, new_chunk):
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
- 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
- # def show_map_if_details(history,choice):
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
- map_html = update_map_with_response(history, history[-1][2])
517
- return gr.update(visible=True), map_html
518
  else:
519
- return gr.update(visible=False), ""
 
 
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']