Narra123 commited on
Commit
5c97488
·
verified ·
1 Parent(s): 20f7907

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -30
app.py DELETED
@@ -1,30 +0,0 @@
1
- import gradio as gr
2
- import google.generativeai as genai
3
- import os
4
-
5
- # Configure API
6
- genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
7
-
8
- model = genai.GenerativeModel("gemini-pro")
9
-
10
- def summarize_text(input_text):
11
- prompt = f"Summarize the following text in simple and clear points:\n\n{input_text}"
12
-
13
- try:
14
- response = model.generate_content(prompt)
15
- return response.text
16
- except Exception as e:
17
- return f"Error: {str(e)}"
18
-
19
- # UI
20
- with gr.Blocks() as demo:
21
- gr.Markdown("## 📝 AI Text Summarizer")
22
-
23
- input_box = gr.Textbox(lines=10, placeholder="Paste your text here...")
24
- output_box = gr.Textbox(label="Summary")
25
-
26
- btn = gr.Button("Summarize")
27
-
28
- btn.click(summarize_text, inputs=input_box, outputs=output_box)
29
-
30
- demo.launch()