Delete space.py
Browse files
space.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import time
|
| 3 |
-
|
| 4 |
-
from app import demo as app
|
| 5 |
-
import os
|
| 6 |
-
|
| 7 |
-
_docs = {'Modal': {'description': 'Modal is a layout element within Blocks that will show its content in a popup above other content.\n from gradio_modal import Modal\n with gr.Blocks() as demo:\n with Modal():\n text1 = gr.Textbox()\n text2 = gr.Textbox()\n btn = gr.Button("Button")', 'members': {'__init__': {'visible': {'type': 'bool', 'default': 'False', 'description': 'If False, column will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'allow_user_close': {'type': 'bool', 'default': 'True', 'description': 'If True, user can close the modal (by clicking outside, clicking the X, or the escape key).'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}}, 'postprocess': {}}, 'events': {}}, '__meta__': {'additional_interfaces': {}}}
|
| 8 |
-
|
| 9 |
-
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
def slow_echo(message, history):
|
| 13 |
-
for i in range(len(message)):
|
| 14 |
-
time.sleep(0.05)
|
| 15 |
-
yield "Tu escribiste: " + message[: i+1]
|
| 16 |
-
|
| 17 |
-
demo = gr.ChatInterface(slow_echo,
|
| 18 |
-
title="Chat básico",
|
| 19 |
-
description= 'Autor: <a href=\"https://huggingface.co/Antonio49\">Antonio Fernández</a> de <a href=\"https://saturdays.ai/\">SaturdaysAI</a>. Formación: <a href=\"https://cursos.saturdays.ai/courses/\">Cursos Online AI</a> Aplicación desarrollada con fines docentes'
|
| 20 |
-
).queue()
|
| 21 |
-
|
| 22 |
-
if __name__ == "__main__":
|
| 23 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|