siddhantuniyal commited on
Commit
7cd1bb6
1 Parent(s): e7a1623

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import google.generativeai as genai
2
+ import gradio as gr
3
+
4
+ api_key = "AIzaSyCmmus8HFPLXskU170_FR4j2CQeWZBKGMY"
5
+
6
+ model = genai.GenerativeModel('gemini-pro')
7
+ genai.configure(api_key = api_key)
8
+
9
+ def get_response(input_text):
10
+
11
+ response = model.generate_content(input_text)
12
+ return response.text
13
+
14
+ iface = gr.Interface(
15
+ fn = get_response,
16
+ inputs = ["text"],
17
+ outputs = ["text"]
18
+ )
19
+ iface.launch()