Skip to content

Commit

Permalink
Upgrade python package (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbradley1 committed Jul 2, 2024
1 parent 8cc83ff commit 04db759
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 730 deletions.
Binary file not shown.
5 changes: 0 additions & 5 deletions backend/graphrag-wheel/note.txt

This file was deleted.

6 changes: 0 additions & 6 deletions backend/src/api/index_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,13 @@ async def generate_prompts(storage_name: str, limit: int = 5):
this_directory = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))
)
print("THIS DIRECTORY: ", this_directory)
print("CWD: ", os.getcwd())

# write custom settings.yaml to a file and store in a temporary directory
data = yaml.safe_load(open(f"{this_directory}/pipeline-settings.yaml"))
data["input"]["container_name"] = sanitized_storage_name
temp_dir = f"/tmp/{sanitized_storage_name}_prompt_tuning"
shutil.rmtree(temp_dir, ignore_errors=True)
os.makedirs(temp_dir, exist_ok=True)
print(f"TEMP SETTINGS DIR: {temp_dir}")
with open(f"{temp_dir}/settings.yaml", "w") as f:
yaml.dump(data, f, default_flow_style=False)

Expand All @@ -306,9 +303,6 @@ async def generate_prompts(storage_name: str, limit: int = 5):
f"{temp_dir}/prompts" # will become a zip file with the name prompts.zip
)
shutil.make_archive(temp_archive, "zip", root_dir=temp_dir, base_dir="prompts")
print(f"ARCHIVE: {temp_archive}.zip")
for f in os.listdir(temp_dir):
print(f"FILE: {f}")

def iterfile(file_path: str):
with open(file_path, mode="rb") as file_like:
Expand Down
2 changes: 1 addition & 1 deletion backend/src/meta_agent/community/retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def read_community_info(
relationships=relationships, entities=entities, ranking_attribute="rank"
)

if covariate_df:
if covariate_df is not None:
claims = read_covariates(
df=covariate_df,
id_col="id",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/2-Advanced_Getting_Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"metadata": {},
"outputs": [],
"source": [
"generate_prompts(storage_name=storage_name, limit=5, zip_file_name=\"prompts.zip\")\n",
"generate_prompts(storage_name=storage_name, limit=1, zip_file_name=\"prompts.zip\")\n",
"with ZipFile(\"prompts.zip\", \"r\") as zip_ref:\n",
" zip_ref.extractall()"
]
Expand Down
798 changes: 83 additions & 715 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "graphrag-solution-accelerator"
version = "0.0.1"
version = "0.1.1"
description = ""
authors = [
"Josh Bradley <joshbradley@microsoft.com>",
Expand Down Expand Up @@ -46,7 +46,7 @@ environs = ">=9.5.0"
fastapi = ">=0.110.0"
fastparquet = ">=2023.10.1"
fsspec = ">=2024.2.0"
graphrag = {path = "backend/graphrag-wheel/graphrag-0.0.1-py3-none-any.whl"}
graphrag = "==0.1.1"
graspologic = ">=3.3.0"
httpx = ">=0.25.2"
kubernetes = ">=29.0.0"
Expand Down

0 comments on commit 04db759

Please sign in to comment.