Skip to content

Commit

Permalink
small bug in batch on schema
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanMarten committed Nov 14, 2024
1 parent 201584f commit 082a046
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions build_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def copy_with_excludes(source, target, excludes=None):
elif source.is_dir():
if target.exists():
shutil.rmtree(target)

def ignore_patterns(path, names):
return [n for n in names if str(Path(path) / n) in excludes]

shutil.copytree(source, target, ignore=ignore_patterns)
print(f"Copied directory {source} to {target}")

Expand Down Expand Up @@ -66,9 +66,7 @@ def nextjs_build():
]

# Paths to exclude
exclude_paths = [
str(source_base / ".next" / "cache")
]
exclude_paths = [str(source_base / ".next" / "cache")]

for item in files_to_copy:
source = source_base / item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def create_api_specific_request(
# TODO(ryan): not sure if this should be something else.
# TODO(ryan): also not sure if we should use strict: True
"name": "output_schema",
"schema": generic_request.response_format.model_json_schema(),
"schema": generic_request.response_format,
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ async def process_generic_requests_from_file(
# Increase the number of open file descriptors to avoid "Too many open files" errors
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(
resource.RLIMIT_NOFILE, (min(hard, 10 * max_requests_per_minute), hard)
resource.RLIMIT_NOFILE,
(min(hard, 10 * max_requests_per_minute), hard),
)

# constants
Expand Down

0 comments on commit 082a046

Please sign in to comment.