Skip to content

Commit

Permalink
Merge branch 'main' into jialli/init-doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
skyline75489 committed Dec 10, 2024
2 parents 291abd7 + 4b12d57 commit 21be96b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions examples/c/src/phi3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ void CXX_API(const char* model_path) {
params->SetSearchOption("max_length", 1024);

auto generator = OgaGenerator::Create(*model, *params);
std::thread th(std::bind(&TerminateSession::Generator_SetTerminate_Call, &catch_terminate, generator.get()));
generator->AppendTokenSequences(*sequences);

while (!generator->IsDone()) {
generator->GenerateNextToken();
try {
while (!generator->IsDone()) {
generator->GenerateNextToken();

if (is_first_token) {
timing.RecordFirstTokenTimestamp();
Expand Down
3 changes: 1 addition & 2 deletions examples/python/phi3-qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def main(args):

params = og.GeneratorParams(model)
params.set_search_options(**search_options)
params.input_ids = input_tokens
generator = og.Generator(model, params)
generator.append_tokens(input_tokens)
if args.verbose: print("Generator created")

if args.verbose: print("Running generation loop ...")
Expand All @@ -53,7 +53,6 @@ def main(args):

try:
while not generator.is_done():
generator.compute_logits()
generator.generate_next_token()
if args.timings:
if first:
Expand Down
1 change: 0 additions & 1 deletion src/ort_genai_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ typedef struct OgaAdapters OgaAdapters;
//! @}

/** \addtogroup Global
*ONNX Runtime Generative AI C API
* @{
*/

Expand Down

0 comments on commit 21be96b

Please sign in to comment.