Skip to content

Commit

Permalink
refactor(pickle): remove timing infra + remove lgos
Browse files Browse the repository at this point in the history
  • Loading branch information
joennlae committed Nov 30, 2024
1 parent 8754128 commit 412ef29
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tests/fsm/test_serialization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pickle
from timeit import default_timer as timer

import pytest
from outlines_core.fsm.guide import RegexGuide
Expand Down Expand Up @@ -50,18 +49,8 @@ def test_complex_serialization(hf_tokenizer_uri, revision):

fsm = RegexGuide.from_regex(regex_str, tokenizer)

start = timer()
serialized = pickle.dumps(fsm)
serialization_time = timer() - start

# Measure deserialization time
start = timer()
deserialized = pickle.loads(serialized)
deserialization_time = timer() - start

assert fsm.eos_tensor == deserialized.eos_tensor
assert fsm.initial_state == deserialized.initial_state

# Print or log the timing results
print(f"Serialization time: {serialization_time:.6f} seconds")
print(f"Deserialization time: {deserialization_time:.6f} seconds")

0 comments on commit 412ef29

Please sign in to comment.