adi-panda/Kuebiko

How to add fine tuned model?

yoshuzx opened this issue · 3 comments

How I can add my custom fine tuned model? this code triggers me error, I don't know why

chat.py
import openai

def open_file(filepath):
with open(filepath, 'r', encoding='utf-8') as infile:
return infile.read()

openai.api_key = "mykey"
openai.api_base = 'https://api.openai.com/v1/chat'

def gpt3_completion(messages, engine='davinci:ft-personal-2023-04-07-21-57-02', temp=0.9, tokens=400, freq_pen=2.0, pres_pen=2.0, stop=['DOGGIEBRO:', 'CHATTER:']):
response = openai.Completion.create(
model=engine,
messages=messages,
temperature=temp,
max_tokens=tokens,
frequency_penalty=freq_pen,
presence_penalty=pres_pen,
stop=stop)
text = response['choices'][0]['message']['content'].strip()
return text

Try using the davinci version from the davinci branch on the github

Thank you! I will try!

Try using the davinci version from the davinci branch on the github

im having problems with the program identifying my googlecloud key:

credentials, project_id = load_credentials_from_file(
File "C:\Users\PC\miniconda3\lib\site-packages\google\auth_default.py", line 121, in load_credentials_from_file
raise exceptions.DefaultCredentialsError(
google.auth.exceptions.DefaultCredentialsError: File.json was not found.

Im I defying the filepath wrong or what is it?