mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-05 19:00:22 +01:00
Added model selection to .env and update readme
This commit is contained in:
@@ -43,7 +43,7 @@ Obviously, it still can't create any production-ready app but the general concep
|
||||
5. `pip install -r requirements.txt` (install the dependencies)
|
||||
6. `cd pilot`
|
||||
7. `mv .env.example .env` (create the .env file)
|
||||
8. Add your OpenAI API key and the database info to the `.env` file
|
||||
8. Add your environment (OpenAI/Azure), your API key and the database info to the `.env` file
|
||||
9. `python db_init.py` (initialize the database)
|
||||
10. `python main.py` (start GPT Pilot)
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ ENDPOINT=OPENAI
|
||||
OPENAI_API_KEY=
|
||||
AZURE_API_KEY=
|
||||
AZURE_ENDPOINT=
|
||||
AZURE_MODEL_NAME=
|
||||
#In case of Azure endpoint, change this to your deployed model name
|
||||
MODEL_NAME=gpt-4
|
||||
DB_NAME=gpt-pilot
|
||||
DB_HOST=localhost
|
||||
DB_PORT=5432
|
||||
|
||||
@@ -46,13 +46,9 @@ def get_tokens_in_messages(messages: List[str]) -> int:
|
||||
tokenized_messages = [tokenizer.encode(message['content']) for message in messages]
|
||||
return sum(len(tokens) for tokens in tokenized_messages)
|
||||
|
||||
# Check if the ENDPOINT is AZURE
|
||||
#get endpoint and model name from .ENV file
|
||||
model = os.getenv('MODEL_NAME')
|
||||
endpoint = os.getenv('ENDPOINT')
|
||||
if endpoint == 'AZURE':
|
||||
# If yes, get the model name from .ENV file
|
||||
model = os.getenv('AZURE_MODEL_NAME')
|
||||
else:
|
||||
model="gpt-4"
|
||||
|
||||
def num_tokens_from_functions(functions, model=model):
|
||||
"""Return the number of tokens used by a list of functions."""
|
||||
|
||||
Reference in New Issue
Block a user