Soltane777 commited on
Commit
fc17b00
·
verified ·
1 Parent(s): 5e17ff2

Update frontend/script.js

Browse files
Files changed (1) hide show
  1. 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//${endpoint}/`, {
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//${endpoint}/`, {
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
  });