Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ openai.api_key = "sk-proj-SiCtnUmjHjNGhdsQHKtcfPs_ra_6UaR30S51Ao9QqgSOJCAwUNw56x
|
|
| 7 |
|
| 8 |
cache_size = 1000
|
| 9 |
expire = 3600 # Cache expiration time in seconds (1 hour)
|
| 10 |
-
cache =
|
| 11 |
|
| 12 |
def generate_response(message):
|
| 13 |
if message in cache:
|
|
|
|
| 7 |
|
| 8 |
cache_size = 1000
|
| 9 |
expire = 3600 # Cache expiration time in seconds (1 hour)
|
| 10 |
+
cache = LRUCache(maxsize=cache_size)
|
| 11 |
|
| 12 |
def generate_response(message):
|
| 13 |
if message in cache:
|