Spaces:
Paused
Paused
dharmendra
commited on
Commit
·
44f89b9
1
Parent(s):
a05ac69
Implement streaming responses for LLM API
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ import traceback
|
|
7 |
#from langchain.memory import ConversationBufferMemory
|
8 |
from langchain.memory import ConversationBufferWindowMemory
|
9 |
from langchain.chains import ConversationChain
|
|
|
|
|
10 |
from langchain_community.llms import HuggingFacePipeline
|
11 |
|
12 |
app = FastAPI()
|
|
|
7 |
#from langchain.memory import ConversationBufferMemory
|
8 |
from langchain.memory import ConversationBufferWindowMemory
|
9 |
from langchain.chains import ConversationChain
|
10 |
+
from starlette.responses import StreamingResponse # <-- NEW IMPORT
|
11 |
+
import asyncio
|
12 |
from langchain_community.llms import HuggingFacePipeline
|
13 |
|
14 |
app = FastAPI()
|