asoria HF staff commited on
Commit
f15f0a4
1 Parent(s): 1628a30

Try to fix GPU error

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  # These imports at the end because of torch/datamapplot issue in Zero GPU
2
  import spaces
3
  import gradio as gr
@@ -11,7 +19,6 @@ import numpy as np
11
  import requests
12
 
13
  from dotenv import load_dotenv
14
- from torch import cuda
15
  from gradio_huggingfacehub_search import HuggingfaceHubSearch
16
  from bertopic import BERTopic
17
  from bertopic.representation import KeyBERTInspired
@@ -21,13 +28,6 @@ from cuml.cluster import HDBSCAN
21
  from huggingface_hub import HfApi
22
  from sklearn.feature_extraction.text import CountVectorizer
23
  from sentence_transformers import SentenceTransformer
24
- from transformers import (
25
- BitsAndBytesConfig,
26
- AutoTokenizer,
27
- AutoModelForCausalLM,
28
- pipeline,
29
- )
30
- from torch import bfloat16
31
  from prompts import REPRESENTATION_PROMPT
32
 
33
  """
 
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
 
19
  import requests
20
 
21
  from dotenv import load_dotenv
 
22
  from gradio_huggingfacehub_search import HuggingfaceHubSearch
23
  from bertopic import BERTopic
24
  from bertopic.representation import KeyBERTInspired
 
28
  from huggingface_hub import HfApi
29
  from sklearn.feature_extraction.text import CountVectorizer
30
  from sentence_transformers import SentenceTransformer
 
 
 
 
 
 
 
31
  from prompts import REPRESENTATION_PROMPT
32
 
33
  """