VEDAGI1 commited on
Commit
d900f6e
·
verified ·
1 Parent(s): eae3bab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -116,7 +116,7 @@ Now, write the complete Python script that performs the analysis and prints a si
116
  ```python
117
  """
118
  generated_text = cohere_chat(prompt_for_coder)
119
- match = re2.search(r"```python
120
  if match:
121
  return match.group(1).strip()
122
  return "print(json.dumps({'error': 'Failed to generate a valid Python script.'}))"
 
116
  ```python
117
  """
118
  generated_text = cohere_chat(prompt_for_coder)
119
+ match = re2.search(r"```python\n(.*?)```", generated_text, re2.DOTALL)
120
  if match:
121
  return match.group(1).strip()
122
  return "print(json.dumps({'error': 'Failed to generate a valid Python script.'}))"