Spaces:
Sleeping
Sleeping
Update frontend/script.js
Browse files- frontend/script.js +4 -4
frontend/script.js
CHANGED
|
@@ -10,7 +10,7 @@ async function uploadFile(endpoint) {
|
|
| 10 |
const formData = new FormData();
|
| 11 |
formData.append("file", file);
|
| 12 |
|
| 13 |
-
const response = await fetch(`https://soltane777-textgeneration.hf.space/
|
| 14 |
method: "POST",
|
| 15 |
body: formData
|
| 16 |
});
|
|
@@ -30,7 +30,7 @@ async function processText(endpoint) {
|
|
| 30 |
const formData = new FormData();
|
| 31 |
formData.append("text", text);
|
| 32 |
|
| 33 |
-
const response = await fetch(`https://soltane777-textgeneration.hf.space/
|
| 34 |
method: "POST",
|
| 35 |
body: formData
|
| 36 |
});
|
|
@@ -48,7 +48,7 @@ async function askQuestion() {
|
|
| 48 |
return;
|
| 49 |
}
|
| 50 |
|
| 51 |
-
const response = await fetch("https://soltane777-textgeneration.hf.space/qa/", {
|
| 52 |
method: "POST",
|
| 53 |
headers: { "Content-Type": "application/json" },
|
| 54 |
body: JSON.stringify({ context: context, question: question })
|
|
@@ -69,7 +69,7 @@ async function generateCode() {
|
|
| 69 |
const formData = new FormData();
|
| 70 |
formData.append("prompt", prompt);
|
| 71 |
|
| 72 |
-
const response = await fetch("https://soltane777-textgeneration.hf.space/generate_code/", {
|
| 73 |
method: "POST",
|
| 74 |
body: formData
|
| 75 |
});
|
|
|
|
| 10 |
const formData = new FormData();
|
| 11 |
formData.append("file", file);
|
| 12 |
|
| 13 |
+
const response = await fetch(`https://soltane777-textgeneration.hf.space/${endpoint}`, { // ✅ تم تصحيح المسار
|
| 14 |
method: "POST",
|
| 15 |
body: formData
|
| 16 |
});
|
|
|
|
| 30 |
const formData = new FormData();
|
| 31 |
formData.append("text", text);
|
| 32 |
|
| 33 |
+
const response = await fetch(`https://soltane777-textgeneration.hf.space/${endpoint}`, { // ✅ تم تصحيح المسار
|
| 34 |
method: "POST",
|
| 35 |
body: formData
|
| 36 |
});
|
|
|
|
| 48 |
return;
|
| 49 |
}
|
| 50 |
|
| 51 |
+
const response = await fetch("https://soltane777-textgeneration.hf.space/qa/", { // ✅ تم تصحيح المسار
|
| 52 |
method: "POST",
|
| 53 |
headers: { "Content-Type": "application/json" },
|
| 54 |
body: JSON.stringify({ context: context, question: question })
|
|
|
|
| 69 |
const formData = new FormData();
|
| 70 |
formData.append("prompt", prompt);
|
| 71 |
|
| 72 |
+
const response = await fetch("https://soltane777-textgeneration.hf.space/generate_code/", { // ✅ تم تصحيح المسار
|
| 73 |
method: "POST",
|
| 74 |
body: formData
|
| 75 |
});
|