Skip to content

Commit

Permalink
Trying to fix the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun authored and Guang Yang committed Dec 17, 2024
1 parent 3c5f757 commit c36e2e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions optimum/exporters/executorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"discover_tasks",
"register_task",
],
"xnnpack": [
"export_to_executorch_with_xnnpack",
],
"__main__": ["main_export"],
}

Expand Down
13 changes: 7 additions & 6 deletions tests/executorch/runtime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from executorch.extension.pybindings.portable_lib import ExecuTorchModule
from transformers import AutoTokenizer
from transformers.testing_utils import (
require_read_token,
slow,
)

Expand Down Expand Up @@ -107,9 +106,9 @@ def test_llama3_2_3b_text_generation_with_xnnpack(self):
self.assertIsInstance(model.model, ExecuTorchModule)

EXPECTED_GENERATED_TEXT = (
"Simply put, the theory of relativity states that the speed of light is constant. This "
"means that no matter how fast you are traveling, the speed of light will always be "
"186,000 miles per second."
"Simply put, the theory of relativity states that time is relative and can be affected "
"by an object's speed. This theory was developed by Albert Einstein in the early 20th "
"century. The theory has two parts"
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
generated_text = model.text_generation(
Expand Down Expand Up @@ -155,7 +154,9 @@ def test_gemma2_text_generation_with_xnnpack(self):
self.assertIsInstance(model, ExecuTorchModelForCausalLM)
self.assertIsInstance(model.model, ExecuTorchModule)

EXPECTED_GENERATED_TEXT = "Hello I am doing a project for my school. I need help with my science homework"
EXPECTED_GENERATED_TEXT = (
"Hello I am doing a project for my school and I need to make sure it is a great to be creative and I can!"
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
generated_text = model.text_generation(
tokenizer=tokenizer,
Expand All @@ -178,7 +179,7 @@ def test_gemma_text_generation_with_xnnpack(self):
self.assertIsInstance(model, ExecuTorchModelForCausalLM)
self.assertIsInstance(model.model, ExecuTorchModule)

EXPECTED_GENERATED_TEXT = "Hello I am doing a project for my school and I need to make a 3D model of a car."
EXPECTED_GENERATED_TEXT = "Hello I am doing a project for my school and I need to write a report on the history of the United States."
tokenizer = AutoTokenizer.from_pretrained(model_id)
generated_text = model.text_generation(
tokenizer=tokenizer,
Expand Down

0 comments on commit c36e2e2

Please sign in to comment.