acecalisto3 commited on
Commit
a517ff5
1 Parent(s): 2ff9596

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -50,6 +50,21 @@ def load_config() -> Dict:
50
  config['api_key'] = os.getenv('HUGGINGFACE_API_KEY', config['api_key'])
51
  return config
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  def setup_logging() -> logging.Logger:
54
  """Set up logging configuration."""
55
  logging.basicConfig(
 
50
  config['api_key'] = os.getenv('HUGGINGFACE_API_KEY', config['api_key'])
51
  return config
52
 
53
+ @spaces.GPU()
54
+ def stream_chat(
55
+ message: str,
56
+ history: list,
57
+ tools: str,
58
+ temperature: float = 0.3,
59
+ max_tokens: int = 1024,
60
+ ):
61
+ # Define persona attributes
62
+ persona_greeting = "Hello! I'm your friendly assistant. How can I help you today?"
63
+
64
+ # Start conversation with persona greeting
65
+ if not history:
66
+ conversation.append(AssistantMessage(content=persona_greeting))
67
+
68
  def setup_logging() -> logging.Logger:
69
  """Set up logging configuration."""
70
  logging.basicConfig(