Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
async def respond(
|
| 2 |
message,
|
| 3 |
history: list[tuple[str, str]],
|
|
@@ -48,4 +61,4 @@ async def respond(
|
|
| 48 |
pass # ์คํธ๋ฆผ ์ข
๋ฃ ์ ์๋ฌด๊ฒ๋ ํ์ง ์์
|
| 49 |
|
| 50 |
if __name__ == "__main__":
|
| 51 |
-
demo.launch()
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import aiohttp
|
| 3 |
+
import os
|
| 4 |
+
import json
|
| 5 |
+
from collections import deque
|
| 6 |
+
|
| 7 |
+
TOKEN = os.getenv("HUGGINGFACE_API_TOKEN")
|
| 8 |
+
|
| 9 |
+
if not TOKEN:
|
| 10 |
+
raise ValueError("API token is not set. Please set the HUGGINGFACE_API_TOKEN environment variable.")
|
| 11 |
+
|
| 12 |
+
memory = deque(maxlen=10)
|
| 13 |
+
|
| 14 |
async def respond(
|
| 15 |
message,
|
| 16 |
history: list[tuple[str, str]],
|
|
|
|
| 61 |
pass # ์คํธ๋ฆผ ์ข
๋ฃ ์ ์๋ฌด๊ฒ๋ ํ์ง ์์
|
| 62 |
|
| 63 |
if __name__ == "__main__":
|
| 64 |
+
demo.launch()
|