seawolf2357 commited on
Commit
e8bac0f
โ€ข
1 Parent(s): 93d46ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
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()