Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,9 @@ import json
|
|
| 12 |
import traceback
|
| 13 |
import spaces # Import the spaces library
|
| 14 |
import tempfile
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class MultiClientThemeClassifier:
|
| 17 |
def __init__(self):
|
|
@@ -33,7 +36,7 @@ class MultiClientThemeClassifier:
|
|
| 33 |
self.model_loaded = False
|
| 34 |
|
| 35 |
print(f"Loading model: {model_name} onto CUDA device")
|
| 36 |
-
self.model = SentenceTransformer(model_name, device='cuda', trust_remote_code=True)
|
| 37 |
self.model_loaded = True
|
| 38 |
self.current_model_name = model_name
|
| 39 |
return f"✅ Model '{model_name}' loaded successfully onto GPU!"
|
|
|
|
| 12 |
import traceback
|
| 13 |
import spaces # Import the spaces library
|
| 14 |
import tempfile
|
| 15 |
+
import os
|
| 16 |
+
token_hf = os.getenv('HF_TOKEN')
|
| 17 |
+
load_dotenv()
|
| 18 |
|
| 19 |
class MultiClientThemeClassifier:
|
| 20 |
def __init__(self):
|
|
|
|
| 36 |
self.model_loaded = False
|
| 37 |
|
| 38 |
print(f"Loading model: {model_name} onto CUDA device")
|
| 39 |
+
self.model = SentenceTransformer(model_name, device='cuda', trust_remote_code=True,token_hf)
|
| 40 |
self.model_loaded = True
|
| 41 |
self.current_model_name = model_name
|
| 42 |
return f"✅ Model '{model_name}' loaded successfully onto GPU!"
|