Spaces:
Sleeping
Sleeping
Update
Browse files- .python-version +1 -0
- app.py +15 -0
- pyproject.toml +9 -0
- uv.lock +0 -0
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.13
|
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def slow_echo(message, history):
|
| 7 |
+
"""Sync generator that simulates slow token-by-token generation."""
|
| 8 |
+
response = ""
|
| 9 |
+
for char in message:
|
| 10 |
+
time.sleep(1) # simulate slow generation (1 token/sec)
|
| 11 |
+
response += char
|
| 12 |
+
yield response
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
gr.ChatInterface(fn=slow_echo).launch()
|
pyproject.toml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "chatinterface-stop"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = "Add your description here"
|
| 5 |
+
readme = "README.md"
|
| 6 |
+
requires-python = ">=3.13"
|
| 7 |
+
dependencies = [
|
| 8 |
+
"gradio>=6.10.0",
|
| 9 |
+
]
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|