GITBOOK-2: FAQ_English
parent
e22f8e18d4
commit
0630c947ec
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
### 1. How to reset the password if the local deployment initialization fails with an incorrect password?
|
||||
|
||||
If deployed using docker compose, you can execute the following command to reset the password:
|
||||
`docker exec -it docker-api-1 flask reset-password`
|
||||
Enter the account email and twice new passwords, and it will be reset.
|
||||
If deployed using docker compose, you can execute the following command to reset the password: `docker exec -it docker-api-1 flask reset-password` Enter the account email and twice new passwords, and it will be reset.
|
||||
|
||||
### 2. How to resolve File not found error in the log when deploying locally?
|
||||
|
||||
|
|
@ -42,8 +40,7 @@ This may be due to switching the domain name/website, causing cross-domain betwe
|
|||
|
||||
**CORS cross-domain configuration**
|
||||
|
||||
`CONSOLE_CORS_ALLOW_ORIGINS` Console CORS cross-domain policy, default to `*`, which allows access from all domain names.
|
||||
`WEB_API_CORS_ALLOW_ORIGINS` WebAPP CORS cross-domain strategy, default to `*`, which allows access from all domain names.
|
||||
`CONSOLE_CORS_ALLOW_ORIGINS` Console CORS cross-domain policy, default to `*`, which allows access from all domain names. `WEB_API_CORS_ALLOW_ORIGINS` WebAPP CORS cross-domain strategy, default to `*`, which allows access from all domain names.
|
||||
|
||||
**Cookie policy configuration**
|
||||
|
||||
|
|
@ -58,8 +55,8 @@ The cookie policy is divided into three configurations `HttpOnly`, `SameSite` an
|
|||
**Recommended Configuration**
|
||||
|
||||
According to the configuration description, we recommend the following configuration in these three scenarios:
|
||||
1. Local debug (default policy)
|
||||
Development mode same domain policy. Support HTTP / HTTPS protocol, but need to ensure that the front-end page and interface are under the same domain.
|
||||
|
||||
1. Local debug (default policy) Development mode same domain policy. Support HTTP / HTTPS protocol, but need to ensure that the front-end page and interface are under the same domain.
|
||||
|
||||
```
|
||||
WEB_API_CORS_ALLOW_ORIGINS:''
|
||||
|
|
@ -69,8 +66,7 @@ COOKIE_SAMESITE: 'Lax'
|
|||
COOKIE_SECURE: 'false'
|
||||
```
|
||||
|
||||
2. Cross-Domain Policy (do not use in production)
|
||||
Cross-domain between server and web client, server must be HTTPS. Since SameSite=None must be coupled with Secure=true, the server must be in the `HTTPS` protocol in order to cross-domain access, which can be used in the server remotely and provide `HTTPS` protocol support, or local start-up server and front-end project (localhost, but different ports, tested available, although prompt warning).
|
||||
2. Cross-Domain Policy (do not use in production) Cross-domain between server and web client, server must be HTTPS. Since SameSite=None must be coupled with Secure=true, the server must be in the `HTTPS` protocol in order to cross-domain access, which can be used in the server remotely and provide `HTTPS` protocol support, or local start-up server and front-end project (localhost, but different ports, tested available, although prompt warning).
|
||||
|
||||
```
|
||||
WEB_API_CORS_ALLOW_ORIGINS: 'https://your-domain-for-web-app'
|
||||
|
|
@ -80,8 +76,7 @@ COOKIE_SAMESITE: 'None'
|
|||
COOKIE_SECURE: 'true'
|
||||
```
|
||||
|
||||
3.Production Policy
|
||||
Strict Mode. Due to the need to support callbacks and cookies for some third-party integration, it is not possible to use the highest Strict policy, so it is necessary to strictly limit the CORS domain name and set the cookie policy to SameSite=Lax, Secure=true.
|
||||
3.Production Policy Strict Mode. Due to the need to support callbacks and cookies for some third-party integration, it is not possible to use the highest Strict policy, so it is necessary to strictly limit the CORS domain name and set the cookie policy to SameSite=Lax, Secure=true.
|
||||
|
||||
```
|
||||
WEB_API_CORS_ALLOW_ORIGINS: 'https://your-domain-for-web-app'
|
||||
|
|
@ -91,17 +86,11 @@ COOKIE_SAMESITE: 'Lax'
|
|||
COOKIE_SECURE: 'true'
|
||||
```
|
||||
|
||||
Unavailable scenarios
|
||||
When the front end and back end are cross-domain and the server-side is http protocol, no Cookie policy can support this scenario. Please adjust the back end to HTTPS protocol or set to the same domain.
|
||||
Unavailable scenarios When the front end and back end are cross-domain and the server-side is http protocol, no Cookie policy can support this scenario. Please adjust the back end to HTTPS protocol or set to the same domain.
|
||||
|
||||
### 4. After starting, the page keeps loading and checking the request prompts CORS error?
|
||||
|
||||
This may be because the domain name/URL has been switched, resulting in cross-domain between the front end and the back end. Please change all the following configuration items in `docker-compose.yml` to the new domain name:
|
||||
`CONSOLE_API_URL:` The backend URL of the console API.
|
||||
`CONSOLE_WEB_URL:` The front-end URL of the console web.
|
||||
`SERVICE_API_URL:` Service API Url
|
||||
`APP_API_URL:` WebApp API backend Url.
|
||||
`APP_WEB_URL:` WebApp Url.
|
||||
This may be because the domain name/URL has been switched, resulting in cross-domain between the front end and the back end. Please change all the following configuration items in `docker-compose.yml` to the new domain name: `CONSOLE_API_URL:` The backend URL of the console API. `CONSOLE_WEB_URL:` The front-end URL of the console web. `SERVICE_API_URL:` Service API Url `APP_API_URL:` WebApp API backend Url. `APP_WEB_URL:` WebApp Url.
|
||||
|
||||
For more information, please check out: [Environments](../install-self-hosted/environments.md)
|
||||
|
||||
|
|
@ -117,9 +106,35 @@ A: [https://www.notion.so/my-integrations](https://www.notion.so/my-integrations
|
|||
|
||||
**Q: Which environment variables need to be configured?**
|
||||
|
||||
A: Please set below configuration when doing the privatized deployment
|
||||
A: Please set below configuration when doing the privatized deployment
|
||||
|
||||
1. **`NOTION_INTEGRATION_TYPE`** : The value should configrate as (**public/internal**). Since the Redirect address of Notion’s Oauth only supports https, if it is deployed locally, please use Notion’s internal integration
|
||||
2. **`NOTION_CLIENT_SECRET`** : Notion OAuth client secret (userd for public integration type)
|
||||
3. **`NOTION_CLIENT_ID`** : OAuth client ID (userd for public integration type)
|
||||
2. **`NOTION_CLIENT_SECRET`** : Notion OAuth client secret (userd for public integration type)
|
||||
3. **`NOTION_CLIENT_ID`** : OAuth client ID (userd for public integration type)
|
||||
4. **`NOTION_INTERNAL_SECRET`** : Notion Internal Integration Secret, If the value of `NOTION_INTEGRATION_TYPE` is **internal** ,you need to configure this variable.
|
||||
|
||||
### 7. How to change the name of the space in the local deployment version?
|
||||
|
||||
Modify in the `tenants` table in the database.
|
||||
|
||||
### 8. Where can I modify the domain name for accessing the application?
|
||||
|
||||
Find the configuration domain name APP\_WEB\_URL in `docker_compose. yal`.
|
||||
|
||||
### 9. If database migration is required, what things need to be backed up?
|
||||
|
||||
The database, configured storage, and vector database data need to be backed up. If deployed in Docker Compose mode, all data content in the `dify/Docker/volumes` directory can be directly backed up.
|
||||
|
||||
### 10. Why is Docker deploying Dify and starting OpenLLM locally using 127.0.0.1, but unable to access the local port?
|
||||
|
||||
`127.0.0.1` is the internal address of the container, and the server address configured by Dify requires the host LAN IP address.
|
||||
|
||||
### 11. How to solve the size and quantity limitations for uploading dataset documents in the local deployment version?
|
||||
|
||||
You can refer to the official website environment variable description document to configure: 
|
||||
|
||||
[Environments](../install-self-hosted/environments.md)
|
||||
|
||||
### 12. How does the local deployment edition invite members through email?
|
||||
|
||||
Local deployment edition, members can be invited through email. After entering the email invitation, the page displays the invitation link, copies the invitation link, and forwards it to users. Your team members can open the link and log in to your space by setting a password through email login.
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
### 1. How to choose a basic model?
|
||||
|
||||
**gpt-3.5-turbo**
|
||||
•gpt-3.5-turbo is an upgraded version of the gpt-3 model series. It is more powerful than gpt-3 and can handle more complex tasks. It has significant improvements in understanding long text and cross-document reasoning. Gpt-3.5 turbo can generate more coherent and persuasive text. It also has great improvements in summarization, translation and creative writing. **Good at: Long text understanding, cross-document reasoning, summary, translation, creative writing**
|
||||
**gpt-3.5-turbo** •gpt-3.5-turbo is an upgraded version of the gpt-3 model series. It is more powerful than gpt-3 and can handle more complex tasks. It has significant improvements in understanding long text and cross-document reasoning. Gpt-3.5 turbo can generate more coherent and persuasive text. It also has great improvements in summarization, translation and creative writing. **Good at: Long text understanding, cross-document reasoning, summary, translation, creative writing**
|
||||
|
||||
**gpt-4**
|
||||
•gpt-4 is the latest and most powerful Transformer language model. It has nearly 200 billion pre-trained parameters, making it state-of-the-art on all language tasks, especially those requiring deep understanding and generation of long, complex responses. Gpt-4 can handle all aspects of human language, including understanding abstract concepts and cross-page reasoning. Gpt-4 is the first true general language understanding system that can handle any natural language processing task in the field of artificial intelligence. **Good at: \*All NLP tasks, language understanding, long text generation, cross-document reasoning, understanding abstract concepts\***Please refer to: [https://platform.openai.com/docs/models/overview](https://platform.openai.com/docs/models/overview)
|
||||
**gpt-4** •gpt-4 is the latest and most powerful Transformer language model. It has nearly 200 billion pre-trained parameters, making it state-of-the-art on all language tasks, especially those requiring deep understanding and generation of long, complex responses. Gpt-4 can handle all aspects of human language, including understanding abstract concepts and cross-page reasoning. Gpt-4 is the first true general language understanding system that can handle any natural language processing task in the field of artificial intelligence. **Good at: \*All NLP tasks, language understanding, long text generation, cross-document reasoning, understanding abstract concepts\***Please refer to: [https://platform.openai.com/docs/models/overview](https://platform.openai.com/docs/models/overview)
|
||||
|
||||
### 2. Why is it recommended to set max_tokens smaller?
|
||||
### 2. Why is it recommended to set max\_tokens smaller?
|
||||
|
||||
Because in natural language processing, longer text outputs usually require longer computation time and more computing resources. Therefore, limiting the length of the output text can reduce the computational cost and time to some extent. For example, set: max_tokens=500, which means that only the first 500 tokens of the output text are considered, and the part exceeding this length will be discarded. The purpose of doing so is to ensure that the length of the output text does not exceed the acceptable range of the LLM, while making full use of computing resources to improve the efficiency of the model. On the other hand, more often limiting max_tokens can increase the length of the prompt, such as the limit of gpt-3.5-turbo is 4097 tokens, if you set max_tokens=4000, then only 97 tokens are left for the prompt, and an error will be reported if exceeded.
|
||||
Because in natural language processing, longer text outputs usually require longer computation time and more computing resources. Therefore, limiting the length of the output text can reduce the computational cost and time to some extent. For example, set: max\_tokens=500, which means that only the first 500 tokens of the output text are considered, and the part exceeding this length will be discarded. The purpose of doing so is to ensure that the length of the output text does not exceed the acceptable range of the LLM, while making full use of computing resources to improve the efficiency of the model. On the other hand, more often limiting max\_tokens can increase the length of the prompt, such as the limit of gpt-3.5-turbo is 4097 tokens, if you set max\_tokens=4000, then only 97 tokens are left for the prompt, and an error will be reported if exceeded.
|
||||
|
||||
### 3. How to split long text data in the dataset reasonably?
|
||||
|
||||
|
|
@ -24,10 +22,100 @@ Finally, experiments and evaluations are still needed to determine the most suit
|
|||
|
||||
### 4. What distance function did we use when getting dataset segmentation?
|
||||
|
||||
We use [cosine similarity](https://en.wikipedia.org/wiki/Cosine_similarity). The choice of distance function is usually irrelevant. OpenAI embeddings are normalized to length 1, which means:
|
||||
We use [cosine similarity](https://en.wikipedia.org/wiki/Cosine\_similarity). The choice of distance function is usually irrelevant. OpenAI embeddings are normalized to length 1, which means:
|
||||
|
||||
•Using the dot product to calculate cosine similarity can be slightly faster •Cosine similarity and Euclidean distance will lead to the same ranking
|
||||
•Using the dot product to calculate cosine similarity can be slightly faster 
|
||||
|
||||
•Cosine similarity and Euclidean distance will lead to the same ranking
|
||||
|
||||
After the embedding vectors are normalized to length 1, calculating the cosine similarity between two vectors can be simplified to their dot product. Because the normalized vectors have a length of 1, the result of the dot product is equal to the result of the cosine similarity.
|
||||
|
||||
Since the dot product calculation is faster than other similarity metrics (such as Euclidean distance), using normalized vectors for dot product calculation can slightly improve computational efficiency.
|
||||
|
||||
### 5. **When filling in the OpenAI key, the error "Validation failed: You exceeded your current quota, please check your plan and billing details" occurs. What is causing this error?**
|
||||
|
||||
This error indicates that the OpenAI key account balance has been used up. Please top up the OpenAI account at openai.com. Refer to [OpenAI ](https://openai.com/pricing)for details on their plans and billing.
|
||||
|
||||
|
||||
|
||||
### 6. When using OpenAI's key for dialogue in the application, there is an error prompt as follows. **What is the cause?**
|
||||
|
||||
Error 1:
|
||||
|
||||
```JSON
|
||||
The server encountered an internal error and was unable to complete your request。Either the server is overloaded or there is an error in the application
|
||||
```
|
||||
|
||||
Error 1:
|
||||
|
||||
```JSON
|
||||
Rate limit reached for default-gpt-3.5-turboin organization org-wDrZCxxxxxxxxxissoZb on requestsper min。 Limit: 3 / min. Please try again in 20s. Contact us through our help center at help.openai.com if you continue to haveissues. Please add a payment method toyour account to increase your rate limit.Visit https://platform.openai.com/account/billingto add a payment method.
|
||||
```
|
||||
|
||||
Please check if the official interface call rate limit has been reached. Please refer to the [official documentation](https://platform.openai.com/docs/guides/rate-limits) for details.
|
||||
|
||||
### 7. After local deployment, Explore-Chat returns an error "Unrecognized request argument supplied: functions". How can this be resolved?
|
||||
|
||||
First, please check that the frontend and backend versions are up-to-date and consistent with each other. This error can also occur if an Azure OpenAI key is being used without successfully deploying the model. Verify that the Azure OpenAI resource has a deployed model - the gpt-3.5-turbo model version must be 0613 or later, as earlier versions do not support the function calling capabilities required by Explore-Chat.
|
||||
|
||||
### 8. When switching models in the app, the following error is encountered:
|
||||
|
||||
```JSON
|
||||
Anthropic: Error code: 400 - f'error': f'type': "invalid request error, 'message': 'temperature: range: -1 or 0..1)
|
||||
```
|
||||
|
||||
This error occurs because each model has different valid ranges for its parameters. Make sure to configure the parameter value according to the allowed range for the current model.
|
||||
|
||||
### 9. How to solve the following error prompt?
|
||||
|
||||
```JSON
|
||||
Query or prefix prompt is too long, you can reduce the preix prompt, or shrink the max token, or switch to a llm with a larger token limit size
|
||||
```
|
||||
|
||||
You can lower the value of "Max token" in the parameter settings of the Prompt Eng. 
|
||||
|
||||
### 10. What are the default models in Dify, and can open-source LLMs be used?
|
||||
|
||||
A: The default models can be configured under **Settings - Model Provider.** Currently supported text generation LLMs include OpenAI, Azure OpenAl, Anthropic, etc. At the same time, open-source LLMs hosted on Hugging Face, Replicate, xinference, etc. can also be integrated.
|
||||
|
||||
### 11. The dataset in Community Edition gets stuck in "Queued" when Q\&A segmentation mode is enabled.
|
||||
|
||||
Please check if the rate limit has been reached for the Embedding model API key used.
|
||||
|
||||
### 12. The error "Invalid token" appears when using the app.
|
||||
|
||||
There are two potential solutions if the error "Invalid token" appears:
|
||||
|
||||
* Clear the browser cache (cookies, session storage, and local storage) or the app cache on mobile. Then, revisit the app.
|
||||
* Regenerate the app URL and access the app again with the new URL. This should resolve the "Invalid token" error.
|
||||
|
||||
### 13. What are the size limits for uploading dataset documents?
|
||||
|
||||
The maximum size for a single document upload is currently 15MB. There is also a limit of 100 total documents. These limits can be adjusted if you are using a local deployment. Refer to the documentation for details on changing the limits.
|
||||
|
||||
### 14. Why does Claude still consume OpenAI credits when using the Claude model?
|
||||
|
||||
The Claude model does not have its own embedding model. Therefore, the embedding process and other dialog generation like next question suggestions default to using OpenAI keys. This means OpenAI credits are still consumed. You can set different default inference and embedding models under **Settings > Model Provider.**
|
||||
|
||||
### 15. Is there any way to control the greater use of dataset data rather than the model's own generation capabilities?
|
||||
|
||||
Whether to use a dataset is related to the description of the dataset. Please write the dataset description clearly as much as possible. Please refer to the [documentation](https://docs.dify.ai/advanced/datasets) for details.
|
||||
|
||||
### 16. How to better segment the uploaded dataset document in Excel?
|
||||
|
||||
Set the header in the first row, and display the content in each subsequent row. Do not have any additional header settings or complex formatted table content.
|
||||
|
||||
### 17. I have already purchased ChatGPT plus, why can't I still use GPT4 in Dify?
|
||||
|
||||
ChatGPT Plus and OpenAI's GPT-4 model API are two separate products with separate pricing. The model APIs have their own pricing structure, see [OpenAI's pricing documentation](https://openai.com/pricing) for details. To get access to the GPT-4 model API, you need to pay for a billing cycle - simply having a payment method on file and access to GPT-3.5 via ChatGPT Plus is not sufficient. Please refer to [OpenAI's official documentation](https://platform.openai.com/account/billing/overview) for complete details on gaining access to GPT-4.
|
||||
|
||||
### 18. How to add other embedding models?
|
||||
|
||||
Dify supports using the Xinference embedded model as an Embedding model, simply select the `Embedding` type in the configuration box.
|
||||
|
||||
### 19. How can I set my own created app as an app template?
|
||||
|
||||
The ability to set your own created app as a template is currently not supported. The existing templates are provided by Dify officially for cloud version users' reference. If you are using the cloud version, you can add apps to your workspace or customize them to make your own after modifications. If you are using the community version and need to create more app templates for your team, you may consult our business team to obtain paid technical support: [business@dify.ai](mailto:business@dify.ai)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue