Spaces:
Runtime error
Runtime error
Commit
·
3259c00
1
Parent(s):
26e7efc
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,22 +4,17 @@ import os
|
|
| 4 |
|
| 5 |
genai.configure(api_key=os.getenv("GOOGLE_PALM_KEY"))
|
| 6 |
|
| 7 |
-
def generate(prompt, history
|
| 8 |
response = genai.chat(
|
| 9 |
-
context=system,
|
| 10 |
messages=prompt)
|
| 11 |
|
| 12 |
return response.last
|
| 13 |
|
| 14 |
-
additional = [
|
| 15 |
-
gr.Textbox(label="System Prompt", max_lines=1, info="English only", value="You are PaLM-2 (AI-assistant from Google)"),
|
| 16 |
-
]
|
| 17 |
|
| 18 |
gr.ChatInterface(
|
| 19 |
fn=generate,
|
| 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
|
| 24 |
concurrency_limit=20,
|
| 25 |
).launch(show_api=False)
|
|
|
|
| 4 |
|
| 5 |
genai.configure(api_key=os.getenv("GOOGLE_PALM_KEY"))
|
| 6 |
|
| 7 |
+
def generate(prompt, history):
|
| 8 |
response = genai.chat(
|
|
|
|
| 9 |
messages=prompt)
|
| 10 |
|
| 11 |
return response.last
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
gr.ChatInterface(
|
| 15 |
fn=generate,
|
| 16 |
chatbot=gr.Chatbot(show_label=False, avatar_images=(None, 'palm-logo.png'), show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
|
|
|
| 17 |
title="PaLM-2",
|
| 18 |
+
description="This is unofficial demo of ```PaLM-2``` based on ```Google API```. ```History/context``` memory does not work in this demo.",
|
| 19 |
concurrency_limit=20,
|
| 20 |
).launch(show_api=False)
|