Spaces:
Paused
Paused
Update backend/main.py
Browse files- backend/main.py +12 -12
backend/main.py
CHANGED
@@ -25,7 +25,7 @@ from mongodb.operations.calls import *
|
|
25 |
from mongodb.models.calls import UserCall, UpdateCall
|
26 |
# from mongodb.endpoints.calls import *
|
27 |
|
28 |
-
from transformers import AutoProcessor, SeamlessM4Tv2Model
|
29 |
|
30 |
# from seamless_communication.inference import Translator
|
31 |
from Client import Client
|
@@ -73,8 +73,8 @@ config = dotenv_values(".env")
|
|
73 |
uri = config['MONGODB_URI']
|
74 |
|
75 |
# Set transformers cache
|
76 |
-
os.environ['HF_HOME'] = './.cache/'
|
77 |
-
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache'
|
78 |
|
79 |
# MongoDB Connection Lifespan Events
|
80 |
@asynccontextmanager
|
@@ -124,14 +124,14 @@ print("=" * 20 + " ⭐️ Starting Server... ⭐️ " + "=" * 20)
|
|
124 |
|
125 |
# TODO PM - change this to the actual path
|
126 |
# seamless remnant code
|
127 |
-
CLIENT_BUILD_PATH = "../streaming-react-app/dist/"
|
128 |
-
static_files = {
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
}
|
135 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
136 |
# processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large", force_download=True)
|
137 |
#cache_dir="/.cache"
|
@@ -143,7 +143,7 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
143 |
|
144 |
bytes_data = bytearray()
|
145 |
model_name = "seamlessM4T_v2_large"
|
146 |
-
vocoder_name = "vocoder_v2" if model_name == "seamlessM4T_v2_large" else "vocoder_36langs"
|
147 |
|
148 |
clients = {}
|
149 |
rooms = {}
|
|
|
25 |
from mongodb.models.calls import UserCall, UpdateCall
|
26 |
# from mongodb.endpoints.calls import *
|
27 |
|
28 |
+
# from transformers import AutoProcessor, SeamlessM4Tv2Model
|
29 |
|
30 |
# from seamless_communication.inference import Translator
|
31 |
from Client import Client
|
|
|
73 |
uri = config['MONGODB_URI']
|
74 |
|
75 |
# Set transformers cache
|
76 |
+
# os.environ['HF_HOME'] = './.cache/'
|
77 |
+
# os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache'
|
78 |
|
79 |
# MongoDB Connection Lifespan Events
|
80 |
@asynccontextmanager
|
|
|
124 |
|
125 |
# TODO PM - change this to the actual path
|
126 |
# seamless remnant code
|
127 |
+
# CLIENT_BUILD_PATH = "../streaming-react-app/dist/"
|
128 |
+
# static_files = {
|
129 |
+
# "/": CLIENT_BUILD_PATH,
|
130 |
+
# "/assets/seamless-db6a2555.svg": {
|
131 |
+
# "filename": CLIENT_BUILD_PATH + "assets/seamless-db6a2555.svg",
|
132 |
+
# "content_type": "image/svg+xml",
|
133 |
+
# },
|
134 |
+
# }
|
135 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
136 |
# processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large", force_download=True)
|
137 |
#cache_dir="/.cache"
|
|
|
143 |
|
144 |
bytes_data = bytearray()
|
145 |
model_name = "seamlessM4T_v2_large"
|
146 |
+
# vocoder_name = "vocoder_v2" if model_name == "seamlessM4T_v2_large" else "vocoder_36langs"
|
147 |
|
148 |
clients = {}
|
149 |
rooms = {}
|