Giter Club home page Giter Club logo

Comments (6)

dosubot avatar dosubot commented on June 19, 2024 2

To prevent your flow from disappearing on Hugging Face after a day when using Langflow 1.0 preview, ensure that your flows are being saved to the database. You can use the saveFlow method to save your flow data. Here is a relevant snippet from the code:

const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
  saveFlow: (flow: FlowType, silent?: boolean) => {
    set({ saveLoading: true });
    return get().saveFlowDebounce(flow, silent);
  },
  saveFlowDebounce: debounce((flow: FlowType, silent?: boolean) => {
    set({ saveLoading: true });
    return new Promise<void>((resolve, reject) => {
      updateFlowInDatabase(flow)
        .then((updatedFlow) => {
          if (updatedFlow) {
            if (!silent) {
              useAlertStore
                .getState()
                .setSuccessData({ title: "Changes saved successfully" });
            }
            get().setFlows(
              get().flows.map((flow) => {
                if (flow.id === updatedFlow.id) {
                  return updatedFlow;
                }
                return flow;
              })
            );
            resolve();
            set({ saveLoading: false });
          }
        })
        .catch((err) => {
          useAlertStore.getState().setErrorData({
            title: "Error while saving changes",
            list: [(err as AxiosError).message],
          });
          reject(err);
        });
    });
  }, SAVE_DEBOUNCE_TIME),
}));

Additionally, check your database settings in the .env file to ensure they are correctly configured:

LANGFLOW_DATABASE_URL=sqlite:///./langflow.db
LANGFLOW_SAVE_DB_IN_CONFIG_DIR=

Make sure LANGFLOW_DATABASE_URL points to your desired database and LANGFLOW_SAVE_DB_IN_CONFIG_DIR is set according to your preference. This should help prevent your flows from disappearing.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from langflow.

dosubot avatar dosubot commented on June 19, 2024 2

You can find the relevant code and configuration settings in the source files of this repository. Specifically, look for the FlowsManagerStore implementation in the frontend code, which is typically located in a file related to state management (e.g., store.js or flowsManagerStore.ts). For the database settings, check the .env file in the root directory of the project.

If you have cloned the repository locally, you can use a text editor or IDE to search for saveFlow and LANGFLOW_DATABASE_URL to locate these sections quickly. If you need further assistance navigating the repository, please let me know!

Details

About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from langflow.

dosubot avatar dosubot commented on June 19, 2024 2

To ensure that your flows are being saved to the database in your Hugging Face deployment of Langflow 1.0 preview, you need to check two main components: the FlowsManagerStore implementation and the .env file.

1. FlowsManagerStore Implementation

The FlowsManagerStore implementation is responsible for managing the saving and retrieval of flows. You can find this implementation in the following file:

2. .env File Configuration

The .env file is used to set environment variables for your application, including database configuration settings. This file is typically located in the root directory of your project. Here is an example of what the .env file might look like:

LANGFLOW_DATABASE_URL=sqlite:///./langflow.db
LANGFLOW_SAVE_DB_IN_CONFIG_DIR=

Ensure that the LANGFLOW_DATABASE_URL is correctly set to point to your database. This setting is crucial for saving your flows to the database.

By ensuring these configurations are correct, you can prevent your flows from disappearing and ensure they are saved persistently in the database.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from langflow.

uiaiek32 avatar uiaiek32 commented on June 19, 2024

where do I look this?

from langflow.

uiaiek32 avatar uiaiek32 commented on June 19, 2024

I have deployed it on Huggingface

from langflow.

uiaiek32 avatar uiaiek32 commented on June 19, 2024

where do I find this on Hugging face ?

from langflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.