Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.'}))"
|