-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed openai broad multimodal compat (#395)
* inital commit * add openapi * fix openapi * add poetry lock * re iterate on Modality dtype * commit wrt to makefile, run_test.sh scripts * re iterate on cli
- Loading branch information
1 parent
3de8ea7
commit 2ff39c6
Showing
37 changed files
with
1,672 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
echo 'Generating CLI v2 documentation...' | ||
|
||
# Get the directory of the script | ||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
||
# Define the output file path relative to the script's location | ||
OUTPUT_FILE="$SCRIPT_DIR/../docs/cli_v2.md" | ||
|
||
# Ensure the output directory exists | ||
mkdir -p "$(dirname "$OUTPUT_FILE")" | ||
|
||
# Write the static content to the output file | ||
cat << EOF > "$OUTPUT_FILE" | ||
# CLI v2 Documentation | ||
The current version of Infinity uses the following arguments in its CLI: | ||
\`\`\`bash | ||
\$ infinity_emb v2 --help | ||
\`\`\` | ||
\`\`\` | ||
EOF | ||
|
||
# Append the help output to the file, setting COLUMNS=80 only for this command | ||
TERMINAL_WIDTH=120 poetry run infinity_emb v2 --help >> "$OUTPUT_FILE" 2>&1 | ||
|
||
# Close the code block in the markdown file | ||
echo '```' >> "$OUTPUT_FILE" | ||
echo 'Note: This doc is auto-generated. Do not edit this file directly.' >> "$OUTPUT_FILE" | ||
|
||
echo "CLI v2 documentation generated and saved to $OUTPUT_FILE." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
||
# Function to handle cleanup | ||
cleanup() { | ||
echo "Cleaning up..." | ||
if [[ -n "${INFINITY_PID:-}" ]]; then | ||
kill "$INFINITY_PID" | ||
fi | ||
} | ||
|
||
# Set up the trap to run the cleanup function on EXIT or any error | ||
trap cleanup EXIT | ||
|
||
# Start infinity_emb in the background | ||
infinity_emb v2 --log-level error --engine debugengine & | ||
INFINITY_PID=$! | ||
echo "infinity_emb started with PID $INFINITY_PID" | ||
|
||
# Wait for infinity_emb to be ready | ||
for i in {1..10}; do | ||
if wget -q --spider http://0.0.0.0:7997/openapi.json; then | ||
echo "infinity_emb is ready." | ||
break | ||
else | ||
echo "Waiting for infinity_emb to be ready..." | ||
sleep 1 | ||
fi | ||
done | ||
|
||
# Download the openapi.json | ||
wget http://0.0.0.0:7997/openapi.json -O "$SCRIPT_DIR/openapi.json" |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
.PHONY: generate tests | ||
|
||
generate: | ||
pip install openapi-python-client==0.21.1 | ||
openapi-python-client generate \ | ||
--url http://0.0.0.0:7997/openapi.json \ | ||
--config client_config.yaml \ | ||
--overwrite \ | ||
--custom-template-path=./template | ||
./run_generate_with_hook.sh | ||
|
||
tests: | ||
./run_tests_with_hook.sh |
Oops, something went wrong.