Skip to content

Commit

Permalink
Use absolute path for module import
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-wanna-M committed Aug 21, 2024
1 parent 57f980d commit 5004ec2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/formatron/grammar_generators/grammar_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions src/formatron/grammar_generators/json_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions src/formatron/integrations/RWKV.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 3 additions & 5 deletions src/formatron/integrations/exllamav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/formatron/integrations/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/formatron/integrations/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/formatron/schemas/dict_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pydantic import typing

import schemas.schema
import formatron.schemas as schemas


class FieldInfo(schemas.schema.FieldInfo):
Expand Down
2 changes: 1 addition & 1 deletion src/formatron/schemas/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 5004ec2

Please sign in to comment.