JeCabrera commited on
Commit
9288502
·
verified ·
1 Parent(s): 4d05ae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -1,16 +1,18 @@
1
  import gradio as gr
2
  import gemini_gradio
3
 
4
- with gr.Blocks(fill_height=True) as demo:
5
- # Centrado con HTML
6
- gr.Markdown("<h1 style='text-align:center;'>CopyMaster</h1>") # Título centrado
7
- gr.Markdown("<h3 style='text-align:center;'>El escritor de ventas que nunca duerme, siempre listo para conectar, cautivar y convencer a tu audiencia.</h3>") # Subtítulo centrado
8
-
9
- gemini_interface = gr.load(
10
- name="gemini-1.5-flash", # Se establece el modelo por defecto
11
- src=gemini_gradio.registry,
12
- fill_height=True,
13
- chatbot=gr.Chatbot(type="messages")
14
- )
15
 
16
- demo.launch(ssr_mode=False)
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import gemini_gradio
3
 
4
+ def echo(message, history, system_prompt, tokens):
5
+ response = f"System prompt: {system_prompt}\n Message: {message}."
6
+ for i in range(min(len(response), int(tokens))):
7
+ time.sleep(0.05)
8
+ yield response[: i + 1]
 
 
 
 
 
 
9
 
10
+ demo = gr.ChatInterface(
11
+ echo,
12
+ additional_inputs=[
13
+ gr.Textbox("You are helpful AI.", label="System Prompt"),
14
+ gr.Slider(10, 100),
15
+ ],
16
+ )
17
+
18
+ demo.launch()