diff --git a/src/formatron/grammar_generators/grammar_generator.py b/src/formatron/grammar_generators/grammar_generator.py index 104d1adc..05e10e86 100644 --- a/src/formatron/grammar_generators/grammar_generator.py +++ b/src/formatron/grammar_generators/grammar_generator.py @@ -4,8 +4,8 @@ import abc import typing -import extractor -import schemas +import formatron.extractor as extractor +import formatron.schemas as schemas class GrammarGenerator(abc.ABC): diff --git a/src/formatron/grammar_generators/json_generator.py b/src/formatron/grammar_generators/json_generator.py index 12dadad9..b13c324e 100644 --- a/src/formatron/grammar_generators/json_generator.py +++ b/src/formatron/grammar_generators/json_generator.py @@ -6,9 +6,9 @@ import types import typing -import extractor -import schemas.schema -from grammar_generators.grammar_generator import GrammarGenerator +import formatron.extractor as extractor +import formatron.schemas as schemas +from formatron.grammar_generators.grammar_generator import GrammarGenerator __all__ = ["JsonGenerator"] diff --git a/src/formatron/integrations/RWKV.py b/src/formatron/integrations/RWKV.py index 5b002b9f..06cae120 100644 --- a/src/formatron/integrations/RWKV.py +++ b/src/formatron/integrations/RWKV.py @@ -5,8 +5,8 @@ import rwkv.utils from kbnf import Token -from config import EngineGenerationConfig -from formatter import FormatterBuilder +from formatron.config import EngineGenerationConfig +from formatron.formatter import FormatterBuilder class PIPELINE_ARGS(rwkv.utils.PIPELINE_ARGS): diff --git a/src/formatron/integrations/exllamav2.py b/src/formatron/integrations/exllamav2.py index f4328023..658cfdc1 100644 --- a/src/formatron/integrations/exllamav2.py +++ b/src/formatron/integrations/exllamav2.py @@ -7,11 +7,9 @@ import torch from exllamav2 import ExLlamaV2Tokenizer, ExLlamaV2 from exllamav2.generator.base import ExLlamaV2Filter -from config import EngineGenerationConfig -from formatter import FormatterBase, FormatterBuilder -from integrations._utils import get_original_characters - -from formatron.formatter import FormatterBase +from formatron.config import EngineGenerationConfig +from formatron.formatter import FormatterBase, FormatterBuilder +from formatron.integrations._utils import get_original_characters def create_engine_vocabulary(tokenizer: ExLlamaV2Tokenizer) -> kbnf.Vocabulary: diff --git a/src/formatron/integrations/transformers.py b/src/formatron/integrations/transformers.py index b37f67fa..826bf462 100644 --- a/src/formatron/integrations/transformers.py +++ b/src/formatron/integrations/transformers.py @@ -8,9 +8,9 @@ import torch from transformers import LogitsProcessor, PreTrainedTokenizerBase, LogitsProcessorList -from config import EngineGenerationConfig -from formatter import FormatterBuilder, FormatterBase -from integrations._utils import get_original_characters +from formatron.config import EngineGenerationConfig +from formatron.formatter import FormatterBuilder, FormatterBase +from formatron.integrations._utils import get_original_characters def create_engine_vocabulary(tokenizer: PreTrainedTokenizerBase) -> kbnf.Vocabulary: diff --git a/src/formatron/integrations/vllm.py b/src/formatron/integrations/vllm.py index bf4c1091..7bd18ef4 100644 --- a/src/formatron/integrations/vllm.py +++ b/src/formatron/integrations/vllm.py @@ -7,9 +7,9 @@ import kbnf from vllm import LLM -from config import EngineGenerationConfig -from formatter import FormatterBase, FormatterBuilder -from integrations._utils import get_original_characters +from formatron.config import EngineGenerationConfig +from formatron.formatter import FormatterBase, FormatterBuilder +from formatron.integrations._utils import get_original_characters class FormattersLogitsProcessor: diff --git a/src/formatron/schemas/dict_inference.py b/src/formatron/schemas/dict_inference.py index 697612fb..91e350fe 100644 --- a/src/formatron/schemas/dict_inference.py +++ b/src/formatron/schemas/dict_inference.py @@ -7,7 +7,7 @@ from pydantic import typing -import schemas.schema +import formatron.schemas as schemas class FieldInfo(schemas.schema.FieldInfo): diff --git a/src/formatron/schemas/pydantic.py b/src/formatron/schemas/pydantic.py index d56fd8dc..b179c437 100644 --- a/src/formatron/schemas/pydantic.py +++ b/src/formatron/schemas/pydantic.py @@ -8,7 +8,7 @@ import pydantic.fields from pydantic import BaseModel, validate_call, ConfigDict, Field -from schemas import schema +from formatron.schemas import schema class FieldInfo(schema.FieldInfo):