-
Notifications
You must be signed in to change notification settings - Fork 1
ParserConstraint #9
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This seems like a very promising project!
I am trying to execute the ParserConstraint example but it get and error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[10], line 28
20 openai.api_key = "..."
23 prompt = Prompt("""
24 %system%You are a sql expert%/system%
25 %user%Write me a query that selects the column y from table b.%/user%
26 """)
---> 28 prompt = await prompt.complete(model=hf, constraint=constraint, name='query', max_tokens=100)
29 # Prompt('
30 # %system%You are a sql expert%/system%
31 # %user%Write me a query that selects the column y from table b.%/user%
32 # SELECT y FROM b')
File /lib/python3.10/site-packages/keymaker/prompt.py:353, in Prompt.complete(self, *completion_args, **completion_kwargs)
341 await stream(
342 Completion(
343 value=value,
(...)
349 ),
350 )
352 while token_count < token_limit:
--> 353 selected_token_ids = await constraint.constrain_tokens(text, partial_completion, model)
355 if selected_token_ids:
356 # if the selected tokens have the same number than the vocab size, there's no real restriction
...
131 model.tokens.keys(),
132 ),
133 )
TypeError: unhashable type: 'ParserConstraint'Any idea why thsi could happen? Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working