Spaces:
Sleeping
Sleeping
File size: 444 Bytes
7cd1bb6 1c461b7 7cd1bb6 1c461b7 7cd1bb6 1c461b7 7cd1bb6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import google.generativeai as genai
import gradio as gr
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv("api_key")
model = genai.GenerativeModel('gemini-pro')
genai.configure(api_key = api_key )
def get_response(input_text):
response = model.generate_content(input_text)
return response.text
iface = gr.Interface(
fn = get_response,
inputs = ["text"],
outputs = ["text"]
)
iface.launch() |