harismlnaslm commited on
Commit
b21430f
·
1 Parent(s): baf2e68

Switch to DialoGPT-large and add better logging

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -86,7 +86,7 @@ class TextilindoAI:
86
  def __init__(self):
87
  self.api_key = os.getenv('HUGGINGFACE_API_KEY')
88
  # Use Llama model for better performance
89
- self.model = os.getenv('DEFAULT_MODEL', 'meta-llama/Llama-2-7b-chat-hf')
90
  self.system_prompt = self.load_system_prompt()
91
 
92
  if not self.api_key:
@@ -155,6 +155,9 @@ Minimum purchase is 1 roll (67-70 yards)."""
155
  # For other models, use the full prompt
156
  prompt = f"<|system|>\n{self.system_prompt}\n<|user|>\n{user_message}\n<|assistant|>\n"
157
 
 
 
 
158
  logger.info(f"Generating response for prompt: {prompt[:100]}...")
159
 
160
  # Generate response with model-specific parameters
 
86
  def __init__(self):
87
  self.api_key = os.getenv('HUGGINGFACE_API_KEY')
88
  # Use Llama model for better performance
89
+ self.model = os.getenv('DEFAULT_MODEL', 'microsoft/DialoGPT-large')
90
  self.system_prompt = self.load_system_prompt()
91
 
92
  if not self.api_key:
 
155
  # For other models, use the full prompt
156
  prompt = f"<|system|>\n{self.system_prompt}\n<|user|>\n{user_message}\n<|assistant|>\n"
157
 
158
+ logger.info(f"Using model: {self.model}")
159
+ logger.info(f"API Key present: {bool(self.api_key)}")
160
+
161
  logger.info(f"Generating response for prompt: {prompt[:100]}...")
162
 
163
  # Generate response with model-specific parameters