Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when upload the file and ingest data #30

Closed
gabrielvalladao opened this issue May 30, 2023 · 4 comments
Closed

Error when upload the file and ingest data #30

gabrielvalladao opened this issue May 30, 2023 · 4 comments

Comments

@gabrielvalladao
Copy link

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 |

@RamiSJ12
Copy link

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

@RattyDAVE
Copy link

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 the reference 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.

@Anil-matcha
Copy link
Contributor

Please check if huggingface sentence transformers are being downloaded during ingest

@gabrielvalladao
Copy link
Author

Solved, need install some pip packages, and upgrade python, tnkxs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants