Comments (6)
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
- src/frontend/src/stores/flowsManagerStore.ts
- src/backend/base/langflow/api/v1/login.py
- src/backend/langflow/services/auth/utils.py
- src/backend/base/langflow/services/auth/utils.py
- src/backend/base/langflow/services/auth/utils.py
- src/backend/base/langflow/api/v1/login.py
- src/backend/base/langflow/services/settings/base.py
- .env.example
- src/backend/base/langflow/services/settings/base.py
- .env.example
- src/backend/base/langflow/services/settings/auth.py
- src/backend/langflow/api/v1/login.py
- src/backend/base/langflow/api/v1/endpoints.py
- src/backend/base/langflow/api/v1/flows.py
- src/backend/base/langflow/api/v1/flows.py
- src/frontend/src/components/crashErrorComponent/index.tsx
- src/frontend/src/App.tsx
- src/frontend/src/App.tsx
- src/backend/base/langflow/utils/logger.py
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.
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.
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:
- File Path:
src/frontend/src/stores/flowsManagerStore.ts
- Repository URL: FlowsManagerStore Implementation
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
- src/frontend/src/stores/flowsManagerStore.ts
- src/frontend/src/stores/flowsManagerStore.ts
- deploy/.env.example
- .env.example
- .env.example
- src/frontend/src/types/zustand/flowsManager/index.ts
- src/backend/langflow/services/database/service.py
- src/backend/langflow/alembic.ini
- src/backend/base/langflow/alembic.ini
- src/frontend/src/controllers/API/index.ts
- src/frontend/src/controllers/API/index.ts
- src/backend/base/langflow/api/v1/flows.py
- src/backend/langflow/api/v1/flows.py
- src/backend/base/langflow/api/v1/flows.py
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.
where do I look this?
from langflow.
I have deployed it on Huggingface
from langflow.
where do I find this on Hugging face ?
from langflow.
Related Issues (20)
- Delete Edge Not Working HOT 5
- Cannot Enter Store API Key on Self-Hosted LangFlow Instance HOT 1
- Get Openai model list from api HOT 2
- OpenAI chat with no max new tokens
- I can't connect the new api on the langflow pre release HOT 5
- I can't connect api to the new langflow pre release this is the body HOT 3
- Error in API cURL option, JSON malformed and missing closing } on tweaks object HOT 2
- Lock type inconsistency between set_cache and upsert methods HOT 3
- poetry going in an infinite loop in installing spacy HOT 2
- pre-release version Installation with pip failed and spacy install loop HOT 6
- Database Connection Pool Settings HOT 1
- RAG and Tool usage , at the same time HOT 2
- Pinecone Search Component not returning records HOT 2
- Langflow run | Migration Issue HOT 3
- Langflow UI stuck in Building without actually building the components HOT 1
- Installation Issue in MacOS HOT 3
- [Security Issue] Code Execution against underlying host system in Custom Component HOT 7
- I can't auth to web ui (deploy with docker frontend+backend) HOT 5
- Request for ARM64 Support in LangFlow Docker Images HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langflow.