Spaces:
Running
on
T4
Running
on
T4
Try to fix torch issue with cuda
Browse files
app.py
CHANGED
@@ -1,11 +1,3 @@
|
|
1 |
-
from torch import cuda, bfloat16
|
2 |
-
from transformers import (
|
3 |
-
BitsAndBytesConfig,
|
4 |
-
AutoTokenizer,
|
5 |
-
AutoModelForCausalLM,
|
6 |
-
pipeline,
|
7 |
-
)
|
8 |
-
|
9 |
# These imports at the end because of torch/datamapplot issue in Zero GPU
|
10 |
# import spaces
|
11 |
import gradio as gr
|
@@ -27,12 +19,20 @@ from bertopic.representation import TextGeneration
|
|
27 |
# Temporary disabling because of ZeroGPU does not support cuml
|
28 |
from cuml.manifold import UMAP
|
29 |
from cuml.cluster import HDBSCAN
|
|
|
30 |
# from umap import UMAP
|
31 |
# from hdbscan import HDBSCAN
|
32 |
from huggingface_hub import HfApi
|
33 |
from sklearn.feature_extraction.text import CountVectorizer
|
34 |
from sentence_transformers import SentenceTransformer
|
35 |
from prompts import REPRESENTATION_PROMPT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
"""
|
38 |
TODOs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# These imports at the end because of torch/datamapplot issue in Zero GPU
|
2 |
# import spaces
|
3 |
import gradio as gr
|
|
|
19 |
# Temporary disabling because of ZeroGPU does not support cuml
|
20 |
from cuml.manifold import UMAP
|
21 |
from cuml.cluster import HDBSCAN
|
22 |
+
|
23 |
# from umap import UMAP
|
24 |
# from hdbscan import HDBSCAN
|
25 |
from huggingface_hub import HfApi
|
26 |
from sklearn.feature_extraction.text import CountVectorizer
|
27 |
from sentence_transformers import SentenceTransformer
|
28 |
from prompts import REPRESENTATION_PROMPT
|
29 |
+
from torch import cuda, bfloat16
|
30 |
+
from transformers import (
|
31 |
+
BitsAndBytesConfig,
|
32 |
+
AutoTokenizer,
|
33 |
+
AutoModelForCausalLM,
|
34 |
+
pipeline,
|
35 |
+
)
|
36 |
|
37 |
"""
|
38 |
TODOs:
|