Dan-wanna-M / formatron

Formatron empowers everyone to control the format of language models' output with minimal overhead.
MIT License
163 stars 6 forks source link

Pip bug: Cannot import submodules on runtime #9

Closed bdashore3 closed 3 months ago

bdashore3 commented 3 months ago

Hi there! I was trying to use this package with tabbyAPI and I get a traceback stating the following:

Traceback (most recent call last):
  File "D:\tabbyAPI\main.py", line 22, in <module>
    from formatron.grammar_generators.json_generator import JsonGenerator
  File "D:\tabbyAPI\venv\Lib\site-packages\formatron\grammar_generators\json_generator.py", line 9, in <module>
    import extractor
ModuleNotFoundError: No module named 'extractor'

Reproduction:

  1. Install the package: pip install formatron
  2. Try importing the JsonGenerator via from formatron.grammar_generators.json_generator import JsonGenerator
  3. Error shows when starting the program
Dan-wanna-M commented 3 months ago

Gonna investigate this

Dan-wanna-M commented 3 months ago

Should be fixed in v0.3.1 now, could you verify it?

bdashore3 commented 3 months ago

Works, thanks!