Skip to content

Commit ec95d82

Browse files
authored
Add NvTenosrRtRtx ep in example file (#1656)
- Add NvTenosrRtRtx ep in example file
1 parent a1dd3ce commit ec95d82

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

examples/chat_app/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def get_ep_name(name):
8282
return "cuda"
8383
elif "dml" in new_name:
8484
return "dml"
85+
elif "nvtensorrtrtx" in new_name:
86+
return "NvTensorRtRtx"
8587
raise ValueError(f"{new_name} is not recognized.")
8688

8789

examples/chat_app/interface/hddr_llm_onnx_interface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import gc
2+
import logging
23
import os
34
import sys
45
import onnxruntime_genai as og

examples/python/model-generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main(args):
7979
if __name__ == "__main__":
8080
parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS, description="End-to-end token generation loop example for gen-ai")
8181
parser.add_argument('-m', '--model_path', type=str, required=True, help='Onnx model folder path (must contain genai_config.json and model.onnx)')
82-
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
82+
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "NvTensorRtRtx", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
8383
parser.add_argument('-pr', '--prompts', nargs='*', required=False, help='Input prompts to generate tokens from. Provide this parameter multiple times to batch multiple prompts')
8484
parser.add_argument('-i', '--min_length', type=int, default=25, help='Min number of tokens to generate including the prompt')
8585
parser.add_argument('-l', '--max_length', type=int, default=50, help='Max number of tokens to generate including the prompt')

examples/python/model-qa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def main(args):
198198
if __name__ == "__main__":
199199
parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS, description="End-to-end AI Question/Answer example for gen-ai")
200200
parser.add_argument('-m', '--model_path', type=str, required=True, help='Onnx model folder path (must contain genai_config.json and model.onnx)')
201-
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
201+
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "NvTensorRtRtx", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
202202
parser.add_argument('-i', '--min_length', type=int, help='Min number of tokens to generate including the prompt')
203203
parser.add_argument('-l', '--max_length', type=int, help='Max number of tokens to generate including the prompt')
204204
parser.add_argument('-ds', '--do_sample', action='store_true', help='Do random sampling. When false, greedy or beam search are used to generate the output. Defaults to false')

examples/python/phi3-qa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def main(args):
8585
if __name__ == "__main__":
8686
parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS, description="End-to-end AI Question/Answer example for gen-ai")
8787
parser.add_argument('-m', '--model_path', type=str, required=True, help='Onnx model folder path (must contain genai_config.json and model.onnx)')
88-
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
88+
parser.add_argument('-e', '--execution_provider', type=str, required=False, default='follow_config', choices=["cpu", "cuda", "dml", "NvTensorRtRtx", "follow_config"], help="Execution provider to run the ONNX Runtime session with. Defaults to follow_config that uses the execution provider listed in the genai_config.json instead.")
8989
parser.add_argument('-i', '--min_length', type=int, help='Min number of tokens to generate including the prompt')
9090
parser.add_argument('-l', '--max_length', type=int, help='Max number of tokens to generate including the prompt')
9191
parser.add_argument('-ds', '--do_sample', action='store_true', default=False, help='Do random sampling. When false, greedy or beam search are used to generate the output. Defaults to false')

0 commit comments

Comments
 (0)