Skip to content

Commit

Permalink
chore: black 23.10 style
Browse files Browse the repository at this point in the history
  • Loading branch information
zhudotexe committed Oct 23, 2023
1 parent a0bbd60 commit 6e1643a
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/1_async_entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
If you haven't already, go take a look at `1_quickstart.py` for an explanation of how to set up kani first.
"""

import asyncio

from kani import Kani
Expand Down
1 change: 1 addition & 0 deletions examples/1_fewshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
If you haven't already, go take a look at `1_quickstart.py` for an explanation of how to set up kani.
"""

import os

from kani import ChatMessage, Kani, chat_in_terminal
Expand Down
1 change: 1 addition & 0 deletions examples/3_customization_exception_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This example shows how to override kani's function call exception handler to use a custom prompt.
"""

import os

from kani import ChatMessage, Kani, ai_function, chat_in_terminal
Expand Down
1 change: 1 addition & 0 deletions examples/3_customization_last_four.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This example shows how to override kani's chat prompt building functionality.
"""

import os

from kani import Kani, chat_in_terminal
Expand Down
1 change: 1 addition & 0 deletions examples/3_customization_log_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This example shows how to override kani's chat history handler to log every message to a JSONL file.
"""

import os

from kani import Kani, chat_in_terminal
Expand Down
1 change: 1 addition & 0 deletions examples/3_customization_track_function_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This example shows how to override kani's function call handler to add instrumentation.
"""

import collections
import datetime
import os
Expand Down
1 change: 1 addition & 0 deletions examples/4_engines_fp4_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
You will need to install ``bitsandbytes`` and ``accelerate`` from pip.
"""

import asyncio
import time

Expand Down
1 change: 1 addition & 0 deletions examples/5_advanced_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
In this example, we implement a simple websocket endpoint that allows a user to chat using WebSockets.
"""

import os

import uvicorn
Expand Down
1 change: 1 addition & 0 deletions examples/5_advanced_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This example shows how kani's function calling functionality can be used to retrieve information from an external
database, e.g. Wikipedia.
"""

import json
import os
from typing import Annotated
Expand Down
1 change: 1 addition & 0 deletions examples/5_advanced_subkanis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
In this example, we show how a sub-kani can use a different engine to perform summarization, then give the results
to the parent kani.
"""

import os

from kani import Kani, ai_function, chat_in_terminal
Expand Down
1 change: 1 addition & 0 deletions kani/engines/llama2_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This file is responsible for implementing the common non-strict ChatMessage to tokens translation, while handling
the nuance of the INST and SYS tokens as best as possible.
"""

import itertools
from typing import Callable, Iterable

Expand Down
1 change: 1 addition & 0 deletions kani/engines/openai/function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
See https://community.openai.com/t/how-to-calculate-the-tokens-when-using-function-call/266573 for more details.
"""

import json
import warnings

Expand Down
1 change: 1 addition & 0 deletions kani/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Model-agnostic classes used to represent the chat state and function calls."""

import abc
import enum
import json
Expand Down
1 change: 1 addition & 0 deletions kani/utils/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The CLI utilities allow you to play with a chat session directly from a terminal."""

import asyncio
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions kani/utils/message_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
You can pass any of these functions in with, e.g., ``Kani.full_round_str(..., message_formatter=all_message_contents)``.
"""

from kani.models import ChatMessage, ChatRole


Expand Down
1 change: 1 addition & 0 deletions tests/test_llama.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run some tests using a real LLaMAv2 model."""

import logging

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_llama2_prompt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests to ensure the LLaMA v2 prompt is correct."""

from kani import ChatMessage
from kani.engines.llama2_prompt import build_str

Expand Down
1 change: 1 addition & 0 deletions tests/test_saveload.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Save -> load should be an identity transformation."""

import random
import string

Expand Down

0 comments on commit 6e1643a

Please sign in to comment.