Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from io import BytesIO
|
|
5 |
from fpdf import FPDF
|
6 |
import requests
|
7 |
from stl import mesh
|
|
|
8 |
|
9 |
# Groq API endpoint and headers
|
10 |
GROQ_API_URL = "https://api.groq.com/v1/query"
|
@@ -72,7 +73,7 @@ uploaded_file = st.file_uploader("Upload a CAD file", type=["stl"])
|
|
72 |
|
73 |
if uploaded_file is not None:
|
74 |
# Save uploaded file temporarily
|
75 |
-
temp_file_path = Path(tempfile.mktemp()) / uploaded_file.name
|
76 |
with open(temp_file_path, "wb") as f:
|
77 |
f.write(uploaded_file.getbuffer())
|
78 |
|
|
|
5 |
from fpdf import FPDF
|
6 |
import requests
|
7 |
from stl import mesh
|
8 |
+
from pathlib import Path # Added import for Path
|
9 |
|
10 |
# Groq API endpoint and headers
|
11 |
GROQ_API_URL = "https://api.groq.com/v1/query"
|
|
|
73 |
|
74 |
if uploaded_file is not None:
|
75 |
# Save uploaded file temporarily
|
76 |
+
temp_file_path = Path(tempfile.mktemp()) / uploaded_file.name # Fixed Path import issue
|
77 |
with open(temp_file_path, "wb") as f:
|
78 |
f.write(uploaded_file.getbuffer())
|
79 |
|