Skip to content

Commit 48370c6

Browse files
committed
Merge branch 'mm_runner_ext' of https://github.com/pytorch/executorch into mm_runner_ext
2 parents a602201 + 13d8d94 commit 48370c6

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,13 @@ if(EXECUTORCH_BUILD_EXTENSION_LLM)
650650
list(APPEND _executorch_extensions tokenizers)
651651
endif()
652652

653+
<<<<<<< HEAD
654+
=======
655+
if(EXECUTORCH_BUILD_EXTENSION_LLM_APPLE)
656+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/apple)
657+
endif()
658+
659+
>>>>>>> 13d8d946c0edc7e0f8df38194406c874f4e2fbbb
653660
if(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
654661
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/runner_util)
655662
install(
@@ -900,10 +907,13 @@ if(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER)
900907
list(APPEND _executorch_extensions extension_llm_runner)
901908
endif()
902909

910+
<<<<<<< HEAD
903911
if(EXECUTORCH_BUILD_EXTENSION_LLM_APPLE)
904912
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/apple)
905913
endif()
906914

915+
=======
916+
>>>>>>> 13d8d946c0edc7e0f8df38194406c874f4e2fbbb
907917
if(EXECUTORCH_BUILD_KERNELS_LLM)
908918
# TODO: move all custom kernels to ${CMAKE_CURRENT_SOURCE_DIR}/kernels/custom
909919
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/custom_ops)

extension/llm/runner/_llm_runner.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class GenerationConfig:
3434
num_eos: int
3535
"""Number of EOS tokens to add to the prompt."""
3636

37+
<<<<<<< HEAD
3738
def __init__(
3839
self,
3940
*,
@@ -46,6 +47,10 @@ class GenerationConfig:
4647
num_eos: int = 0,
4748
) -> None:
4849
"""Initialize GenerationConfig with optional keyword arguments for all fields."""
50+
=======
51+
def __init__(self) -> None:
52+
"""Initialize GenerationConfig with default values."""
53+
>>>>>>> 13d8d946c0edc7e0f8df38194406c874f4e2fbbb
4954
...
5055

5156
def resolve_max_new_tokens(
@@ -368,6 +373,7 @@ class MultimodalRunner:
368373
Raises:
369374
RuntimeError: If generation fails
370375
"""
376+
<<<<<<< HEAD
371377
...
372378

373379
def generate(
@@ -406,6 +412,8 @@ class MultimodalRunner:
406412
Raises:
407413
RuntimeError: If prefill fails
408414
"""
415+
=======
416+
>>>>>>> 13d8d946c0edc7e0f8df38194406c874f4e2fbbb
409417
...
410418

411419
def generate_text(
@@ -424,6 +432,7 @@ class MultimodalRunner:
424432
Raises:
425433
RuntimeError: If generation fails
426434
"""
435+
<<<<<<< HEAD
427436
...
428437

429438
def generate_text(self, inputs: dict, config: GenerationConfig) -> str:
@@ -432,6 +441,8 @@ class MultimodalRunner:
432441
433442
See generate(inputs: dict, ...) for expected keys and constraints.
434443
"""
444+
=======
445+
>>>>>>> 13d8d946c0edc7e0f8df38194406c874f4e2fbbb
435446
...
436447

437448
def stop(self) -> None:

extension/llm/runner/pybindings.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ PYBIND11_MODULE(_llm_runner, m) {
165165
py::class_<GenerationConfig>(m, "GenerationConfig")
166166
// Constructor with keyword arguments for all fields (all optional via
167167
// defaults)
168-
.def(
169168
py::init([](bool echo,
170169
int32_t max_new_tokens,
171170
bool warming,
@@ -190,9 +189,6 @@ PYBIND11_MODULE(_llm_runner, m) {
190189
py::arg("temperature") = 0.8f,
191190
py::arg("num_bos") = 0,
192191
py::arg("num_eos") = 0)
193-
.def_readwrite("echo", &GenerationConfig::echo)
194-
.def_readwrite("max_new_tokens", &GenerationConfig::max_new_tokens)
195-
.def_readwrite("warming", &GenerationConfig::warming)
196192
.def_readwrite("seq_len", &GenerationConfig::seq_len)
197193
.def_readwrite("temperature", &GenerationConfig::temperature)
198194
.def_readwrite("num_bos", &GenerationConfig::num_bos)

0 commit comments

Comments
 (0)