Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion auditor/generations/paraphrase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List, Optional
import os
import openai
import litellm

from auditor.perturbations.constants import OPENAI_CHAT_COMPLETION

Expand Down Expand Up @@ -37,7 +38,7 @@ def generate_similar_sentences(
engine = model
api_version = api_version

response = openai.ChatCompletion.create(
response = litellm.completion(
model=model,
messages=payload,
temperature=temperature,
Expand Down
3 changes: 2 additions & 1 deletion auditor/perturbations/paraphrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re

import openai
import litellm

from auditor.perturbations.base import TransformBase
from auditor.perturbations.constants import OPENAI_CHAT_COMPLETION
Expand Down Expand Up @@ -73,7 +74,7 @@ def transform(
"content": prompt
}
]
response = openai.ChatCompletion.create(
response = litellm.completion(
model=self.model,
messages=payload,
temperature=self.temperature,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies = [
"jinja2==3.1.2",
"langchain>=0.0.158,<=0.0.330",
"openai>=0.27.0,<=0.28.1",
"litellm==0.13.2",
"sentence-transformers>=2.2.2",
"tqdm>=4.66.1",
"httplib2~=0.22.0"
Expand Down