Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to new OpenAI models #28

Merged
merged 2 commits into from
Jan 29, 2024
Merged
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
2 changes: 1 addition & 1 deletion scripts/encode_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, chunk_size=500, parent_chunk_size=1000, child_chunk_size=100,
self.do_parent_document = do_parent_document

self.embeddings_model = OpenAIEmbeddings(
model="text-embedding-ada-002")
model="text-embedding-3-large", dimensions=1536)

self.text_splitter = TokenTextSplitter(chunk_size=chunk_size, chunk_overlap=0)

Expand Down
2 changes: 1 addition & 1 deletion scripts/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
client = QdrantClient("0.0.0.0", port=6333)
openai_client = OpenAI()

model = "text-embedding-ada-002"
model = "text-embedding-3-small"
prompt = ""
embeddings = openai_client.embeddings.create(
input = prompt,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/completion/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { QdrantClient } from '@qdrant/js-client-rest';

import { default as SYSTEM_PROMPT_TEXT } from './system_prompt';

const DEFAULT_MODEL = 'gpt-4-1106-preview';
const DEFAULT_MODEL = 'gpt-4-turbo-preview';
const DEFAULT_COLLECTION = 'default';

export class ChatbotCompletion {
Expand Down Expand Up @@ -42,7 +42,7 @@ export class ChatbotCompletion {

this.embeddings_model = new OpenAIEmbeddings({
openAIApiKey: openai_api_key,
modelName: 'text-embedding-ada-002'
modelName: 'text-embedding-3-small'
});
this.qdrant_client = new QdrantClient({
url: 'http://' + (process.env.QDRANT_HOST ?? 'localhost') + ':6333'
Expand Down
Loading