Skip to content

Commit

Permalink
fix literal import
Browse files Browse the repository at this point in the history
  • Loading branch information
noahshinn committed Aug 4, 2023
1 parent f5ac520 commit e085b08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions alfworld_runs/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import os
import sys
import openai
from tenacity import (
retry,
stop_after_attempt, # type: ignore
wait_random_exponential, # type: ignore
)

from typing import Optional, List, Union, Literal
from typing import Optional, List
if sys.version_info >= (3, 7):
from typing import Literal
else:
from typing_extensions import Literal


Model = Literal["gpt-4", "gpt-3.5-turbo", "text-davinci-003"]

Expand Down Expand Up @@ -41,4 +47,4 @@ def get_chat(prompt: str, model: Model, max_tokens: int = 256, stop_strs: Option
max_tokens=max_tokens,
stop=stop_strs,
)
return response.choices[0].message.content
return response.choices[0].message.content
1 change: 1 addition & 0 deletions programming_runs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ astunparse==1.6.3
torch
xformers
transformers
accelerate

0 comments on commit e085b08

Please sign in to comment.