Error when upload the file and ingest data
gabrielvalladao opened this issue · comments
Unhandled Runtime Error
ReferenceError: response is not defined
Source
components\ConfigSideNav.js (27:3) @ response
25 | } catch (error) {
26 | setIsLoading(false);
27 | response.text().then(text => {toast.error("Error Ingesting data."+text);})
| ^
28 | }
29 | };
30 |
Should have 👇
function(req, response) {
You don't have a variable named response
in the scope of the callback. That is the reason for the reference error
Should have point_down
function(req, response) {
You don't have a variable named
response
in the scope of the callback. That is the reason for thereference error
It is not clear what we need to do to fix.
Looking at https://github.com/SamurAIGPT/privateGPT/blob/main/client/components/ConfigSideNav.js
we have the section of code
"use client";
import React, { useState } from "react";
import { Button, Stack, Form,Spinner } from "react-bootstrap";
import { ToastContainer, toast } from "react-toastify";
export default function ConfigSideNav() {
const [isLoading, setIsLoading] = useState(false);
const [downloadInProgress, setdownloadInProgress] = useState(false);
const [selectedFile, setSelectedFile] = useState(null);
const [isUploading, setIsUploading] = useState(null);
const ingestData = async () => {
try {
setIsLoading(true);
const res = await fetch("http://localhost:5000/ingest");
const jsonData = await res.json();
if (!res.ok) {
// This will activate the closest `error.js` Error Boundary
console.log("Error Ingesting data");
setIsLoading(false);
} else {
setIsLoading(false);
console.log(jsonData);
}
} catch (error) {
setIsLoading(false);
response.text().then(text => {toast.error("Error Ingesting data."+text);})
}
};
Any help would be great.
Please check if huggingface sentence transformers are being downloaded during ingest
Solved, need install some pip packages, and upgrade python, tnkxs!