mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 21:27:53 -05:00
Added check for too big files
This commit is contained in:
@@ -55,6 +55,12 @@ def call_openai_gpt(prompt, context, model="gpt-35-turbo"):
|
||||
|
||||
if tokens > 14000:
|
||||
model = "gpt-4-turbo"
|
||||
if tokens > 124000:
|
||||
print("Too many tokens, skipping")
|
||||
print('-'*80)
|
||||
print(prompt)
|
||||
print('-'*80)
|
||||
return 'File too big so cannot be processed.'
|
||||
|
||||
stream = client.chat.completions.create(
|
||||
model=model,
|
||||
|
||||
Reference in New Issue
Block a user