manikandan18ramalingam commited on
Commit
cbf7dbd
·
verified ·
1 Parent(s): 75ab51b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -42,12 +42,9 @@ def check_file_size(file):
42
 
43
 
44
  def save_uploaded_file_to_temp(uploaded_file) -> str:
45
- # Explicit temp directory (works reliably on HF Spaces)
46
- tmp_dir = Path("/app")
47
- tmp_dir.mkdir(parents=True, exist_ok=True)
48
 
49
  safe_name = uploaded_file.name.replace("/", "_").replace("\\", "_")
50
- save_path = tmp_dir / safe_name
51
 
52
  with open(save_path, "wb") as f:
53
  f.write(uploaded_file.getbuffer())
@@ -274,7 +271,7 @@ for i, tab_name in enumerate(TABS):
274
  st.success(f"Uploaded file: {uploaded_file.name} ({file_size:.2f} MB)")
275
 
276
  # Save to temp and use the full path for downstream processing
277
- # file_path = save_uploaded_file_to_temp(uploaded_file)
278
 
279
  confidence_score = st.number_input(
280
  "Adjust Confidence Score",
 
42
 
43
 
44
  def save_uploaded_file_to_temp(uploaded_file) -> str:
 
 
 
45
 
46
  safe_name = uploaded_file.name.replace("/", "_").replace("\\", "_")
47
+ save_path = "./"
48
 
49
  with open(save_path, "wb") as f:
50
  f.write(uploaded_file.getbuffer())
 
271
  st.success(f"Uploaded file: {uploaded_file.name} ({file_size:.2f} MB)")
272
 
273
  # Save to temp and use the full path for downstream processing
274
+ file_path = save_uploaded_file_to_temp(uploaded_file)
275
 
276
  confidence_score = st.number_input(
277
  "Adjust Confidence Score",