Skip to content

Commit

Permalink
Merge branch 'infiniflow:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
isthaison authored Nov 27, 2024
2 parents b207aff + 2229431 commit faa0fda
Show file tree
Hide file tree
Showing 30 changed files with 435 additions and 128 deletions.
2 changes: 1 addition & 1 deletion api/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def rewrite_yaml_conf(conf_path, config):


def rewrite_json_file(filepath, json_data):
with open(filepath, "w") as f:
with open(filepath, "w", encoding='utf-8') as f:
json.dump(json_data, f, indent=4, separators=(",", ": "))
f.close()

Expand Down
9 changes: 6 additions & 3 deletions deepdoc/parser/resume/entities/schools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# limitations under the License.
#

import os, json,re,copy
import os
import json
import re
import copy
import pandas as pd
current_file_path = os.path.dirname(os.path.abspath(__file__))
TBL = pd.read_csv(os.path.join(current_file_path, "res/schools.csv"), sep="\t", header=0).fillna("")
Expand All @@ -23,7 +26,7 @@
def loadRank(fnm):
global TBL
TBL["rank"] = 1000000
with open(fnm, "r",encoding='UTF-8') as f:
with open(fnm, "r", encoding='utf-8') as f:
while True:
l = f.readline()
if not l:break
Expand All @@ -32,7 +35,7 @@ def loadRank(fnm):
nm,rk = l[0].strip(),int(l[1])
#assert len(TBL[((TBL.name_cn == nm) | (TBL.name_en == nm))]),f"<{nm}>"
TBL.loc[((TBL.name_cn == nm) | (TBL.name_en == nm)), "rank"] = rk
except Exception as e:
except Exception:
pass


Expand Down
2 changes: 1 addition & 1 deletion deepdoc/vision/t_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main(args):
"score": 1} for b, t in bxs if b[0][0] <= b[1][0] and b[0][1] <= b[-1][1]]
img = draw_box(images[i], bxs, ["ocr"], 1.)
img.save(outputs[i], quality=95)
with open(outputs[i] + ".txt", "w+") as f:
with open(outputs[i] + ".txt", "w+", encoding='utf-8') as f:
f.write("\n".join([o["text"] for o in bxs]))


Expand Down
2 changes: 1 addition & 1 deletion deepdoc/vision/t_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def main(args):
if args.mode.lower() == "tsr":
#lyt = [t for t in lyt if t["type"] == "table column"]
html = get_table_html(images[i], lyt, ocr)
with open(outputs[i] + ".html", "w+") as f:
with open(outputs[i] + ".html", "w+", encoding='utf-8') as f:
f.write(html)
lyt = [{
"type": t["label"],
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- **docker-compose.yml**
Sets up environment for RAGFlow and its dependencies.
- **docker-compose-base.yml**
Sets up environment for RAGFlow's dependencies: Elasticsearch, MySQL, MinIO, and Redis.
Sets up environment for RAGFlow's dependencies: Elasticsearch/[Infinity](https://github.com/infiniflow/infinity), MySQL, MinIO, and Redis.

## 🐬 Docker environment variables

Expand Down
2 changes: 1 addition & 1 deletion docs/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker compose -f docker/docker-compose.yml up -d
- **docker-compose.yml**
Sets up environment for RAGFlow and its dependencies.
- **docker-compose-base.yml**
Sets up environment for RAGFlow's dependencies: Elasticsearch, MySQL, MinIO, and Redis.
Sets up environment for RAGFlow's dependencies: Elasticsearch/[Infinity](https://github.com/infiniflow/infinity), MySQL, MinIO, and Redis.

## Docker environment variables

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Guides",
"position": 2,
"position": 3,
"link": {
"type": "generated-index",
"description": "Guides for RAGFlow users and developers."
Expand Down
2 changes: 1 addition & 1 deletion docs/references/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "References",
"position": 4,
"position": 6,
"link": {
"type": "generated-index",
"description": "Miscellaneous References"
Expand Down
2 changes: 1 addition & 1 deletion docs/references/http_api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ Failure:

---

## Create session with an agent
## Create session with agent

**POST** `/api/v1/agents/{agent_id}/sessions`

Expand Down
52 changes: 48 additions & 4 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Released on November 26, 2024.

### New features

- Supports [Infinity](https://github.com/infiniflow/infinity) or Elasticsearch (default) as document engine for vector storage and full-text indexing.
- Supports [Infinity](https://github.com/infiniflow/infinity) or Elasticsearch (default) as document engine for vector storage and full-text indexing. [#2894](https://github.com/infiniflow/ragflow/pull/2894)
- Enhances user experience by adding more variables to the Agent and implementing auto-saving.
- Adds a three-step translation agent template, inspired by [Andrew Ng's translation agent](https://github.com/andrewyng/translation-agent).
- Adds an SEO-optimized blog writing agent template.
Expand All @@ -22,16 +22,60 @@ Released on November 26, 2024.
- Optimizes term weight calculations, reducing the retrieval time by 50%.
- Improves task executor monitoring with additional performance indicators.
- Replaces Redis with Valkey.
- Adds three new UI languages (contributed by community): Indonesian, Spanish, and Vietnamese.
- Adds three new UI languages (*contributed by the community*): Indonesian, Spanish, and Vietnamese.

### Compatability changes

As of this release, **service_config.yaml.template** replaces **service_config.yaml** for configuring backend services. Upon Docker container startup, the environment variables defined in this template file are automatically populated and a **service_config.yaml** is auto-generated from it. [#3341](https://github.com/infiniflow/ragflow/pull/3341)

This approach eliminates the need to manually update **service_config.yaml** after making changes to **.env**, facilitating dynamic environment configurations.

:::danger
Ensure that you [upgrade both your code and Docker image to this release](https://ragflow.io/docs/dev/upgrade_ragflow#upgrade-ragflow-to-the-most-recent-officially-published-release) before trying this new approach.
:::

### Related APIs

#### HTTP APIs

- [Create session with agent](https://ragflow.io/docs/dev/http_api_reference#create-session-with-an-agent)
- [Create session with agent](https://ragflow.io/docs/dev/http_api_reference#create-session-with-agent)
- [Converse with agent](https://ragflow.io/docs/dev/http_api_reference#converse-with-agent)

#### Python APIs

- [Create session with agent](https://ragflow.io/docs/dev/python_api_reference#create-session-with-agent)
- [Converse with agent](https://ragflow.io/docs/dev/python_api_reference#create-session-with-agent)
- [Converse with agent](https://ragflow.io/docs/dev/python_api_reference#create-session-with-agent)

### Documentation

#### Added documents

- [Configurations](https://ragflow.io/docs/dev/configurations)
- [Manage team members](https://ragflow.io/docs/dev/manage_team_members)
- [Run health check on RAGFlow's dependencies](https://ragflow.io/docs/dev/run_health_check)

## v0.13.0

- Adds the team management functionality for all users.
- Updates the Agent UI to improve usability.
- Adds support for Markdown chunking in the **General** chunk method.
- Introduces an **invoke** tool within the Agent UI.
- Integrates support for Dify's knowledge base API.
- Adds support for GLM4-9B and Yi-Lightning models.
- Introduces HTTP and Python APIs for dataset management, file management within dataset, and chat assistant management.

:::tip NOTE
To download RAGFlow's Python SDK:

```bash
pip install ragflow-sdk==0.13.0
```
:::

### Documentation

#### Added documents

- [Acquire a RAGFlow API key](https://ragflow.io/docs/dev/acquire_ragflow_api_key)
- [HTTP API Reference](https://ragflow.io/docs/dev/http_api_reference)
- [Python API Reference](https://ragflow.io/docs/dev/python_api_reference)
4 changes: 2 additions & 2 deletions graphrag/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def merge_into_first(sres, title="") -> dict[str, str]:
q_vec = matchDense.embedding_data
src = req.get("fields", ["docnm_kwd", "content_ltks", "kb_id", "img_id", "title_tks", "important_kwd",
"doc_id", f"q_{len(q_vec)}_vec", "position_list", "name_kwd",
"q_1024_vec", "q_1536_vec", "available_int", "content_with_weight",
"weight_int", "weight_flt", "rank_int"
"available_int", "content_with_weight",
"weight_int", "weight_flt"
])

fusionExpr = FusionExpr("weighted_sum", 32, {"weights": "0.5, 0.5"})
Expand Down
Loading

0 comments on commit faa0fda

Please sign in to comment.