Spaces:
Runtime error
Runtime error
remove unnecessary transformers dependency
Browse files- retrieval.py +3 -13
retrieval.py
CHANGED
@@ -1,8 +1,4 @@
|
|
1 |
-
import json
|
2 |
import os
|
3 |
-
import pathlib
|
4 |
-
import sys
|
5 |
-
import time
|
6 |
from typing import Any, Dict, List
|
7 |
|
8 |
# for vector search
|
@@ -10,23 +6,17 @@ import pinecone # cloud-hosted vector database for context retrieval
|
|
10 |
# for auto-gpu selection
|
11 |
from langchain.embeddings import HuggingFaceEmbeddings
|
12 |
from langchain.vectorstores import Pinecone
|
13 |
-
from PIL import Image
|
14 |
-
|
15 |
-
from transformers import (AutoModelForSequenceClassification, AutoTokenizer,
|
16 |
-
GPT2Tokenizer, OPTForCausalLM,
|
17 |
-
T5ForConditionalGeneration)
|
18 |
|
19 |
# load custom code
|
20 |
-
|
21 |
from gpu_memory_utils import (get_device_with_most_free_memory,
|
22 |
get_free_memory_dict,
|
23 |
get_gpu_ids_with_sufficient_memory)
|
24 |
|
25 |
-
|
26 |
-
from clip_for_ppts import ClipImage
|
27 |
|
28 |
-
LECTURE_SLIDES_DIR = os.path.join(os.getcwd(), "lecture_slides")
|
29 |
|
|
|
30 |
PINECONE_API_KEY = os.environ.get("PINECONE_API")
|
31 |
|
32 |
|
|
|
|
|
1 |
import os
|
|
|
|
|
|
|
2 |
from typing import Any, Dict, List
|
3 |
|
4 |
# for vector search
|
|
|
6 |
# for auto-gpu selection
|
7 |
from langchain.embeddings import HuggingFaceEmbeddings
|
8 |
from langchain.vectorstores import Pinecone
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# load custom code
|
11 |
+
from clip_for_ppts import ClipImage
|
12 |
from gpu_memory_utils import (get_device_with_most_free_memory,
|
13 |
get_free_memory_dict,
|
14 |
get_gpu_ids_with_sufficient_memory)
|
15 |
|
16 |
+
# from PIL import Image
|
|
|
17 |
|
|
|
18 |
|
19 |
+
LECTURE_SLIDES_DIR = os.path.join(os.getcwd(), "lecture_slides")
|
20 |
PINECONE_API_KEY = os.environ.get("PINECONE_API")
|
21 |
|
22 |
|