ehristoforu commited on
Commit
adefb9c
·
1 Parent(s): a0de629

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -4,15 +4,11 @@ import os
4
 
5
  genai.configure(api_key=os.getenv("GOOGLE_PALM_KEY"))
6
 
7
- global past
8
- past = ""
9
-
10
  def generate(prompt, history, system):
11
- global past
12
  response = genai.chat(
13
- context=past+", "+system,
14
  messages=prompt)
15
- past += response.last
16
  return response.last
17
 
18
  additional = [
@@ -24,5 +20,6 @@ gr.ChatInterface(
24
  chatbot=gr.Chatbot(show_label=False, avatar_images=(None, 'palm-logo.png'), show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
25
  additional_inputs=additional,
26
  title="PaLM-2",
 
27
  concurrency_limit=20,
28
  ).launch(show_api=False)
 
4
 
5
  genai.configure(api_key=os.getenv("GOOGLE_PALM_KEY"))
6
 
 
 
 
7
  def generate(prompt, history, system):
 
8
  response = genai.chat(
9
+ context=system,
10
  messages=prompt)
11
+
12
  return response.last
13
 
14
  additional = [
 
20
  chatbot=gr.Chatbot(show_label=False, avatar_images=(None, 'palm-logo.png'), show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
21
  additional_inputs=additional,
22
  title="PaLM-2",
23
+ description="This is unofficial demo of PaLM-2 based on Google API. History/context memory does not work in this demo."
24
  concurrency_limit=20,
25
  ).launch(show_api=False)