gnumanth commited on
Commit
dd18d76
1 Parent(s): 6369a92

init0: palm2chat

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import google.generativeai as palm
3
+ import os
4
+
5
+ palm.configure(api_key=os.environ.get('API_Key'))
6
+
7
+ def palm2chat(message, history):
8
+ response = palm.chat(messages=[message])
9
+ return response.last
10
+
11
+ demo = gr.ChatInterface(fn=palm2chat).queue()
12
+
13
+ demo.launch()