import os import gspread from oauth2client.service_account import ServiceAccountCredentials # Read the authentication token from the environment variable hugging_face_token = os.getenv("HUGGING_FACE_TOKEN") replicate_token = os.getenv("REPLICATE_TOKEN") # Google Sheets configuration def init_google_sheets_client(): scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"] creds = ServiceAccountCredentials.from_json_keyfile_name('tokyo-portal-326513-90aee094bab9.json', scope) return gspread.authorize(creds) # Google Sheets name google_sheets_name = "Chatbot Test" # Define available models huggingface_tokenizer = { "Meta-Llama-3-8B-Instruct": "meta-llama/Meta-Llama-3-8B-Instruct", "Llama-2-7B-Chat": "meta-llama/Llama-2-7b-chat-hf", "mistralai/mistral-7b-instruct-v0.2": "mistralai/Mistral-7B-Instruct-v0.2", } #Avaiable models for replicate replicate_model= { "Meta-Llama-3-8B-Instruct": "meta/meta-llama-3-8b-instruct", "Llama-2-7B-Chat": "meta/llama-2-7b-chat", "mistralai/mistral-7b-instruct-v0.2": "mistralai/mistral-7b-instruct-v0.2", } # Default model (first in list) default_model_name = list(replicate_model.items())[0][0] # Define available user names user_names = ["Laura Musto", "Brian Carpenter", "Germán Capdehourat", "Isabel Amigo", "Aiala Rosá", "Luis Chiruzzo", "Ignacio Sastre", "Santiago Góngora", "Ignacio Remersaro", "Rodrigo Souza"] MAX_INTERACTIONS = 5