JairoCesar commited on
Commit
c91b80f
·
verified ·
1 Parent(s): b3db55f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ def get_inference_client():
13
 
14
  def extract_and_clean_json(text):
15
  # Intenta encontrar un JSON válido en el texto
16
- json_match = re.search(r'\{.*\}', text, re.DOTALL)
17
  if json_match:
18
  json_str = json_match.group()
19
  # Limpia el JSON de caracteres no válidos
@@ -70,7 +70,7 @@ def create_powerpoint(slides, template_name):
70
  prs = Presentation(template_path)
71
 
72
  for slide_data in slides:
73
- slide = prs.slides.add_slide(prs.slide_layouts[0])
74
 
75
  title_shape = slide.shapes.title
76
  content_shape = slide.placeholders[1]
 
13
 
14
  def extract_and_clean_json(text):
15
  # Intenta encontrar un JSON válido en el texto
16
+ json_match = re.search(r'\{(?:[^{}]|(?R))*\}', text, re.DOTALL)
17
  if json_match:
18
  json_str = json_match.group()
19
  # Limpia el JSON de caracteres no válidos
 
70
  prs = Presentation(template_path)
71
 
72
  for slide_data in slides:
73
+ slide = prs.slides.add_slide(prs.slide_layouts[1])
74
 
75
  title_shape = slide.shapes.title
76
  content_shape = slide.placeholders[1]