kmuthudurai commited on
Commit
45a2314
·
verified ·
1 Parent(s): a6e39e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -135,7 +135,7 @@ This JSON format will be used to store and manage invoices in a structured and u
135
  )
136
  content = response.choices[0].message.content.strip()
137
  print("Before content:", content)
138
- cleaned_content = re.sub(r'^```json\n', '', content) # Remove '```json\n' at the beginning
139
  cleaned_content = re.sub(r'\n```$', '', cleaned_content) # Remove '\n```' at the end
140
 
141
  # Step 2: Parse the cleaned content as JSON
 
135
  )
136
  content = response.choices[0].message.content.strip()
137
  print("Before content:", content)
138
+ cleaned_content = re.sub(r'^.*```json\n', '', content) # Remove '```json\n' at the beginning
139
  cleaned_content = re.sub(r'\n```$', '', cleaned_content) # Remove '\n```' at the end
140
 
141
  # Step 2: Parse the cleaned content as JSON