Skip to content

Commit

Permalink
Fix arg specification (Azure-Samples#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox authored Jun 24, 2024
1 parent 28536f6 commit ef14801
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions scripts/prepdocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ if ($env:USE_FEATURE_INT_VECTORIZATION) {
}

if ($env:AZURE_OPENAI_API_KEY) {
$openaiApiKey = $env:AZURE_OPENAI_API_KEY
} else {
$openaiApiKey = $env:OPENAI_API_KEY
$openaiApiKeyArg = "--openaikey $env:AZURE_OPENAI_API_KEY"
} elseif ($env:OPENAI_API_KEY) {
$openaiApiKeyArg = "--openaikey $env:OPENAI_API_KEY"
}

$cwd = (Get-Location)
Expand All @@ -81,8 +81,8 @@ $argumentList = "./app/backend/prepdocs.py $dataArg --verbose " + `
"$searchAnalyzerNameArg " + `
"--openaihost `"$env:OPENAI_HOST`" --openaimodelname `"$env:AZURE_OPENAI_EMB_MODEL_NAME`" $openaiDimensionsArg " + `
"--openaiservice `"$env:AZURE_OPENAI_SERVICE`" --openaideployment `"$env:AZURE_OPENAI_EMB_DEPLOYMENT`" " + `
"--openaicustomurl `"$env:OPENAI_CUSTOM_URL`" " + `
"--openaikey `"$env:OPENAI_API_KEY`" --openaiorg `"$env:OPENAI_ORGANIZATION`" " + `
"--openaicustomurl `"$env:AZURE_OPENAI_CUSTOM_URL`" " + `
"$openaiApiKeyArg --openaiorg `"$env:OPENAI_ORGANIZATION`" " + `
"--documentintelligenceservice $env:AZURE_DOCUMENTINTELLIGENCE_SERVICE " + `
"$searchImagesArg $visionEndpointArg " + `
"$adlsGen2StorageAccountArg $adlsGen2FilesystemArg $adlsGen2FilesystemPathArg " + `
Expand Down
6 changes: 3 additions & 3 deletions scripts/prepdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ if [ -n "$USE_FEATURE_INT_VECTORIZATION" ]; then
fi

if [ -n "$AZURE_OPENAI_API_KEY" ]; then
openAiApiKeyArg="$AZURE_OPENAI_API_KEY"
openAiApiKeyArg="--openaikey $AZURE_OPENAI_API_KEY"
elif [ -n "$OPENAI_API_KEY" ]; then
openAiApiKeyArg="$OPENAI_API_KEY"
openAiApiKeyArg="--openaikey $OPENAI_API_KEY"
fi

./.venv/bin/python ./app/backend/prepdocs.py './data/*' --verbose \
Expand All @@ -77,7 +77,7 @@ $searchAnalyzerNameArg \
--openaihost "$OPENAI_HOST" --openaimodelname "$AZURE_OPENAI_EMB_MODEL_NAME" $openAiDimensionsArg \
--openaiservice "$AZURE_OPENAI_SERVICE" --openaideployment "$AZURE_OPENAI_EMB_DEPLOYMENT" \
--openaicustomurl "$AZURE_OPENAI_CUSTOM_URL" \
--openaikey $openAiApiKeyArg --openaiorg "$OPENAI_ORGANIZATION" \
$openAiApiKeyArg --openaiorg "$OPENAI_ORGANIZATION" \
--documentintelligenceservice "$AZURE_DOCUMENTINTELLIGENCE_SERVICE" \
$searchImagesArg $visionEndpointArg \
$adlsGen2StorageAccountArg $adlsGen2FilesystemArg $adlsGen2FilesystemPathArg \
Expand Down

0 comments on commit ef14801

Please sign in to comment.