SpaceMonkey25 commited on
Commit
6662a2c
·
verified ·
1 Parent(s): dd40ff9

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -57,8 +57,8 @@ from datetime import datetime
57
 
58
  #====================================SETUP=====================================#
59
  # Fetch secrets from Hugging Face Spaces
60
- api_key = config.get("API_KEY")
61
- endpoint = config.get("OPENAI_API_BASE")
62
  llama_api_key = os.environ['GROQ_API_KEY']
63
  MEM0_api_key = os.environ['mem0']
64
 
@@ -549,8 +549,8 @@ class NutritionBot:
549
  # Initialize the OpenAI client using the provided credentials
550
  self.client = ChatOpenAI(
551
  model_name="gpt-4o-mini", # Specify the model to use (e.g., GPT-4 optimized version)
552
- api_key=config.get("API_KEY"), # API key for authentication
553
- base_url = config.get("OPENAI_API_BASE"),
554
  temperature=0 # Controls randomness in responses; 0 ensures deterministic results
555
  )
556
 
 
57
 
58
  #====================================SETUP=====================================#
59
  # Fetch secrets from Hugging Face Spaces
60
+ api_key = os.environ['API_KEY']
61
+ endpoint = os.environ['OPENAI_API_BASE']
62
  llama_api_key = os.environ['GROQ_API_KEY']
63
  MEM0_api_key = os.environ['mem0']
64
 
 
549
  # Initialize the OpenAI client using the provided credentials
550
  self.client = ChatOpenAI(
551
  model_name="gpt-4o-mini", # Specify the model to use (e.g., GPT-4 optimized version)
552
+ api_key=os.environ['API_KEY'],
553
+ base_url=os.environ['OPENAI_API_BASE'],
554
  temperature=0 # Controls randomness in responses; 0 ensures deterministic results
555
  )
556