Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +3 -1
index.html
CHANGED
|
@@ -83,8 +83,10 @@ async function init(){
|
|
| 83 |
await pyodide.loadPackage(["numpy", "pillow", "opencv-python", "scipy", "scikit-image"]);
|
| 84 |
setStatus("Tracer engine load ho raha hai…");
|
| 85 |
const core = await (await fetch("vectorizer_core.py")).text();
|
|
|
|
| 86 |
pyodide.FS.writeFile("/vectorizer_core.py", core);
|
| 87 |
-
|
|
|
|
| 88 |
setStatus("Tayyar! Image select karo aur Convert dabao.");
|
| 89 |
$("convert").disabled = false;
|
| 90 |
$("convert").textContent = "Convert to SVG";
|
|
|
|
| 83 |
await pyodide.loadPackage(["numpy", "pillow", "opencv-python", "scipy", "scikit-image"]);
|
| 84 |
setStatus("Tracer engine load ho raha hai…");
|
| 85 |
const core = await (await fetch("vectorizer_core.py")).text();
|
| 86 |
+
if(!core || core.length < 1000) throw new Error("vectorizer_core.py download nahi ho saki");
|
| 87 |
pyodide.FS.writeFile("/vectorizer_core.py", core);
|
| 88 |
+
if(!pyodide.FS.analyzePath("/vectorizer_core.py").exists) throw new Error("file write failed");
|
| 89 |
+
await pyodide.runPythonAsync("import sys; sys.path.insert(0, '/')\nimport vectorizer_core as vc");
|
| 90 |
setStatus("Tayyar! Image select karo aur Convert dabao.");
|
| 91 |
$("convert").disabled = false;
|
| 92 |
$("convert").textContent = "Convert to SVG";
|