Skip to content

Commit 87ddc7c

Browse files
committed
format
1 parent 3f18803 commit 87ddc7c

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "runpod-worker"]
22
path = infra/runpod
33
url = https://github.com/runpod-workers/worker-infinity-embedding
4+
[submodule "infra/sap/sap-core-ai"]
5+
path = infra/sap/sap-core-ai
6+
url = https://github.com/SAP-samples/btp-generative-ai-hub-use-cases

libs/infinity_emb/infinity_emb/infinity_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,16 @@ def _construct(name: str):
497497
# gets the default value from the ENV Manager
498498
default=getattr(MANAGER, name),
499499
# envvar is a dummy that is there for documentation purposes.
500-
envvar=f'`{MANAGER.to_name(name)}`',
500+
envvar=f"`{MANAGER.to_name(name)}`",
501501
)
502502

503503
@tp.command("v2")
504504
def v2(
505505
# t
506506
# arguments for engine
507507
model_id: list[str] = typer.Option(
508-
**_construct("model_id"), help="Huggingface model repo id. Subset of possible models: https://huggingface.co/models?other=text-embeddings-inference&"
508+
**_construct("model_id"),
509+
help="Huggingface model repo id. Subset of possible models: https://huggingface.co/models?other=text-embeddings-inference&",
509510
),
510511
served_model_name: list[str] = typer.Option(
511512
**_construct("served_model_name"),
@@ -595,7 +596,7 @@ def v2(
595596
\n
596597
Multi-Model CLI Playbook: \n
597598
- 1. specific options can be combinedmodels. i.e. `v2 --model-id model/no1 --model-id/no2 --batch-size 8 --batch-size 4` \n
598-
- 2. this is identical to setting ENV Variables to: INFINITY_MODEL_ID="model/no1;model/no2;" && INFINITY_BATCH_SIZE="8;4;" \n
599+
- 2. this is identical to setting ENV Variables to: INFINITY_MODEL_ID="model/no1;model/no2;" && INFINITY_BATCH_SIZE="8;4;" \n
599600
- 3. single items are broadcasted to model-id length!
600601
"""
601602
# old

libs/infinity_emb/infinity_emb/transformer/acceleration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def to_bettertransformer(
3434
)
3535
return model
3636

37-
if os.environ.get("INFINITY_DISABLE_OPTIMUM", False):
37+
if os.environ.get("INFINITY_DISABLE_OPTIMUM", False):
3838
# TODO: remove this code path, it just prints this warning
3939
logger.error(
4040
"DEPRECATED the `INFINITY_DISABLE_OPTIMUM` - setting optimizations via BetterTransformer,"
4141
"INFINITY_DISABLE_OPTIMUM is no longer supported, please use the CLI / ENV for that."
4242
)
43-
43+
4444
if (
4545
hasattr(model.config, "_attn_implementation")
4646
and model.config._attn_implementation != "eager"

libs/infinity_emb/infinity_emb/transformer/crossencoder/optimum.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def __init__(self, *, engine_args: EngineArgs):
4141
engine_args.model_name_or_path,
4242
execution_provider=provider,
4343
file_name=onnx_file.as_posix(),
44-
optimize_model=not os.environ.get("INFINITY_ONNX_DISABLE_OPTIMIZE", False), # TODO: make this env variable public
44+
optimize_model=not os.environ.get(
45+
"INFINITY_ONNX_DISABLE_OPTIMIZE", False
46+
), # TODO: make this env variable public
4547
model_class=ORTModelForSequenceClassification,
4648
revision=engine_args.revision,
4749
trust_remote_code=engine_args.trust_remote_code,

libs/infinity_emb/infinity_emb/transformer/embedder/optimum.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def __init__(self, *, engine_args: EngineArgs):
5757
trust_remote_code=engine_args.trust_remote_code,
5858
execution_provider=provider,
5959
file_name=onnx_file.as_posix(),
60-
optimize_model=not os.environ.get("INFINITY_ONNX_DISABLE_OPTIMIZE", False), # TODO: make this env variable public
60+
optimize_model=not os.environ.get(
61+
"INFINITY_ONNX_DISABLE_OPTIMIZE", False
62+
), # TODO: make this env variable public
6163
model_class=ORTModelForFeatureExtraction,
6264
)
6365
self.model.use_io_binding = False

0 commit comments

Comments
 (0)