Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -211,6 +211,7 @@
|
|
211 |
from langdetect import detect
|
212 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextGenerationPipeline, GenerationConfig
|
213 |
import torch
|
|
|
214 |
import logging
|
215 |
from fastapi import FastAPI, Request, HTTPException, status
|
216 |
from pydantic import BaseModel, Field
|
@@ -219,6 +220,14 @@ import asyncio
|
|
219 |
from concurrent.futures import ThreadPoolExecutor
|
220 |
from fastapi.middleware.cors import CORSMiddleware
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
logging.basicConfig(level=logging.INFO)
|
223 |
logger = logging.getLogger(__name__)
|
224 |
|
|
|
211 |
from langdetect import detect
|
212 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextGenerationPipeline, GenerationConfig
|
213 |
import torch
|
214 |
+
import os
|
215 |
import logging
|
216 |
from fastapi import FastAPI, Request, HTTPException, status
|
217 |
from pydantic import BaseModel, Field
|
|
|
220 |
from concurrent.futures import ThreadPoolExecutor
|
221 |
from fastapi.middleware.cors import CORSMiddleware
|
222 |
|
223 |
+
from langchain.vectorstores import Qdrant
|
224 |
+
from langchain.embeddings import HuggingFaceEmbeddings
|
225 |
+
from langchain.chains import RetrievalQA
|
226 |
+
from langchain.llms import HuggingFacePipeline
|
227 |
+
from qdrant_client import QdrantClient
|
228 |
+
|
229 |
+
|
230 |
+
|
231 |
logging.basicConfig(level=logging.INFO)
|
232 |
logger = logging.getLogger(__name__)
|
233 |
|