Spaces:
Sleeping
Sleeping
Commit
·
ce93ad2
1
Parent(s):
2912b81
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,17 @@ from bs4 import BeautifulSoup
|
|
17 |
import nltk
|
18 |
import torch
|
19 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
|
|
21 |
# Initialize FastAPI app
|
22 |
app = FastAPI()
|
23 |
|
@@ -82,11 +92,6 @@ def load_models():
|
|
82 |
print(f"Error loading models: {e}")
|
83 |
return False
|
84 |
|
85 |
-
import pickle
|
86 |
-
import numpy as np
|
87 |
-
import os
|
88 |
-
from typing import Dict, Optional
|
89 |
-
import codecs
|
90 |
|
91 |
class LFSEmbeddingsUnpickler(pickle.Unpickler):
|
92 |
def persistent_load(self, pid):
|
|
|
17 |
import nltk
|
18 |
import torch
|
19 |
import pandas as pd
|
20 |
+
import subprocess
|
21 |
+
from typing import Dict, Optional
|
22 |
+
import codecs
|
23 |
+
|
24 |
+
try:
|
25 |
+
subprocess.run(['git', 'lfs', 'pull'], check=True)
|
26 |
+
print("Successfully pulled LFS files")
|
27 |
+
except Exception as e:
|
28 |
+
print(f"Error pulling LFS files: {e}")
|
29 |
|
30 |
+
|
31 |
# Initialize FastAPI app
|
32 |
app = FastAPI()
|
33 |
|
|
|
92 |
print(f"Error loading models: {e}")
|
93 |
return False
|
94 |
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
class LFSEmbeddingsUnpickler(pickle.Unpickler):
|
97 |
def persistent_load(self, pid):
|