Skip to content

Commit

Permalink
Clean up notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
slundberg committed Apr 19, 2023
1 parent beeab01 commit 5eec0b9
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 161 deletions.
4 changes: 2 additions & 2 deletions guidance/llms/_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(self, model=None, caching=True, max_retries=5, max_calls_per_min=60
self._tokenizer = tiktoken.get_encoding("cl100k_base")
self.chat_mode = chat_mode

self.model = model
self.model_name = model
self.caching = caching
self.max_retries = max_retries
self.max_calls_per_min = max_calls_per_min
Expand Down Expand Up @@ -169,7 +169,7 @@ def __call__(self, prompt, stop=None, stop_regex=None, temperature=None, n=1, ma
try:
self.add_call()
call_args = {
"model": self.model,
"model": self.model_name,
"prompt": prompt,
"max_tokens": max_tokens,
"temperature": temperature,
Expand Down
8 changes: 8 additions & 0 deletions notebooks/anachronism.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@
"print('Few-shot', (np.array(labels) == fews).mean())\n",
"print('Structured output', (np.array(labels) == structs).mean())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<hr style=\"height: 1px; opacity: 0.5; border: none; background: #cccccc;\">\n",
"<div style=\"text-align: center; opacity: 0.5\">Have an idea for more helpful examples? Pull requests that add to this documentation notebook are encouraged!</div>"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 5eec0b9

Please sign in to comment.