Skip to content

Commit

Permalink
Add type hints for generate
Browse files Browse the repository at this point in the history
  • Loading branch information
jncraton committed Jan 4, 2024
1 parent 1a065a3 commit 7254bd7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions languagemodels/inference.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import List
import requests
import re
import os
Expand Down Expand Up @@ -111,14 +112,14 @@ def chat_oa(engine, prompt, max_tokens=200, temperature=0):


def generate(
instructions,
max_tokens=200,
temperature=0.1,
topk=1,
repetition_penalty=1.3,
prefix="",
suppress=[],
model="instruct",
instructions: List[str],
max_tokens: int = 200,
temperature: float = 0.1,
topk: int = 1,
repetition_penalty: float = 1.3,
prefix: str = "",
suppress: List[str] = [],
model: str = "instruct",
):
"""Generates completions for a prompt
Expand Down

0 comments on commit 7254bd7

Please sign in to comment.