Spaces:
Sleeping
Sleeping
Deepa Shalini commited on
Commit ·
3ed7ab7
1
Parent(s): d687f11
updated temp write permission
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import dash
|
|
| 2 |
from dash import html, dcc, callback, Output, Input, State
|
| 3 |
import dash_mantine_components as dmc
|
| 4 |
import pandas as pd
|
|
|
|
|
|
|
| 5 |
from utils import prompt, helpers
|
| 6 |
from gallery_data import GALLERY_DATA
|
| 7 |
|
|
@@ -587,8 +589,8 @@ def create_graph(n_clicks, user_prompt, stored_data, filename):
|
|
| 587 |
df = pd.DataFrame(stored_data)
|
| 588 |
|
| 589 |
# Save the dataframe temporarily for processing
|
| 590 |
-
|
| 591 |
-
temp_file_path = os.path.join(
|
| 592 |
df.to_csv(temp_file_path, index=False)
|
| 593 |
|
| 594 |
# Get first 5 rows as CSV string
|
|
|
|
| 2 |
from dash import html, dcc, callback, Output, Input, State
|
| 3 |
import dash_mantine_components as dmc
|
| 4 |
import pandas as pd
|
| 5 |
+
import os
|
| 6 |
+
import tempfile
|
| 7 |
from utils import prompt, helpers
|
| 8 |
from gallery_data import GALLERY_DATA
|
| 9 |
|
|
|
|
| 589 |
df = pd.DataFrame(stored_data)
|
| 590 |
|
| 591 |
# Save the dataframe temporarily for processing
|
| 592 |
+
temp_dir = tempfile.gettempdir()
|
| 593 |
+
temp_file_path = os.path.join(temp_dir, "temp_uploaded_data.csv")
|
| 594 |
df.to_csv(temp_file_path, index=False)
|
| 595 |
|
| 596 |
# Get first 5 rows as CSV string
|