humanify icon indicating copy to clipboard operation
humanify copied to clipboard

Module 'guidance' has no attribute 'llms'

Open cairocoder opened this issue 2 years ago • 2 comments

When I run below: npm start -- --local -o unminified.js app.min.js I got an error: AttributeError: module 'guidance' has no attribute 'llms'. Did you mean: 'llm'?

Here's the full terminal output:

Traceback (most recent call last):
  File "/Users/cairocoder/Sites/localhost/humanify/local-inference/inference-server.py", line 3, in <module>
    from rename import rename
  File "/Users/cairocoder/Sites/localhost/humanify/local-inference/rename.py", line 2, in <module>
    from guidance_config import guidance
  File "/Users/cairocoder/Sites/localhost/humanify/local-inference/guidance_config.py", line 4, in <module>
    guidance.llm = guidance.llms.Transformers(mname, device="mps", caching=False, temperature=0.5)
                   ^^^^^^^^^^^^^
AttributeError: module 'guidance' has no attribute 'llms'. Did you mean: 'llm'?

cairocoder avatar Nov 25 '23 04:11 cairocoder

I have the same issue

aaronegger avatar Mar 21 '24 16:03 aaronegger

Try changing it to this:

import guidance from guidance import models

mname = "meta-llama/Llama-2-7b-chat-hf" guidance.llm = models.Transformers(mname, device="mps", caching=False, temperature=0.5)

aaronegger avatar Mar 21 '24 16:03 aaronegger

Fixed at v2, no Python needed anymore

jehna avatar Aug 12 '24 19:08 jehna

which version of guidance you have ? I guess it has developed and changed its API.

AGenchev avatar Aug 13 '24 07:08 AGenchev

I actually dropped guidance (and python) in v2, I'm now using gbnf grammars to force a specific output instead of using Guidance.

jehna avatar Aug 13 '24 08:08 jehna