Spaces:
Sleeping
Sleeping
File size: 703 Bytes
976e010 8d44432 976e010 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#credits: openskyml
import google.generativeai as genai
import gradio as gr
import os
genai.configure(api_key=os.getenv("GOOGLE_PALM_API_KEY"))
def generate(prompt, history):
response = genai.chat(
messages=prompt)
return response.last
gr.ChatInterface(
fn=generate,
chatbot=gr.Chatbot(show_label=False, avatar_images=(None, 'palm-logo.png'), show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
title="PaLM-2 demo",
description="This is a quick poc demo of ```PaLM-2``` based on ```Google API```. ```History/context``` \n ```example: write me a recommedation letter for a PhD program.```",
concurrency_limit=20,
).launch(show_api=False)
|