TejAndrewsACC commited on
Commit
ce85bb5
·
verified ·
1 Parent(s): e122adc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -6,10 +6,9 @@ def random_response(message, history):
6
  # Creating a persistent chat session with history for each user chat.
7
  client = Client("TejAndrewsACC/Z3taACC-Plus")
8
 
9
- # Make API call to chat with message and previous history
10
  result = client.predict(
11
- message=message,
12
- history=history,
13
  max_tokens=2048,
14
  temperature=0.7,
15
  top_p=0.95,
@@ -17,7 +16,7 @@ def random_response(message, history):
17
  )
18
 
19
  # Return the response and updated history as a dictionary
20
- return {"text": result, "history": history + [(message, result)]}
21
 
22
  # Set up Gradio chat interface
23
  demo = gr.ChatInterface(
@@ -28,7 +27,7 @@ demo = gr.ChatInterface(
28
  show_progress="full",
29
  flagging_mode="manual",
30
  editable=True,
31
- theme="TejAndrewsACC/zetaofficalthemeacc"
32
  )
33
 
34
  if __name__ == "__main__":
 
6
  # Creating a persistent chat session with history for each user chat.
7
  client = Client("TejAndrewsACC/Z3taACC-Plus")
8
 
9
+ # Make API call to chat with message
10
  result = client.predict(
11
+ message=message, # Removed history from here
 
12
  max_tokens=2048,
13
  temperature=0.7,
14
  top_p=0.95,
 
16
  )
17
 
18
  # Return the response and updated history as a dictionary
19
+ return result, history + [(message, result)] # Append the current message and response to history
20
 
21
  # Set up Gradio chat interface
22
  demo = gr.ChatInterface(
 
27
  show_progress="full",
28
  flagging_mode="manual",
29
  editable=True,
30
+ theme="TejAndrewsACC/zetaofficalthemeacc" # Make sure this theme exists
31
  )
32
 
33
  if __name__ == "__main__":