Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
from flask import Flask
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
API_URL = "https://api-inference.huggingface.co/models/sentence-transformers/all-MiniLM-L6-v2"
|
|
@@ -13,9 +14,10 @@ app = Flask(__name__)
|
|
| 13 |
|
| 14 |
@app.route('/app')
|
| 15 |
def server_app():
|
| 16 |
-
|
| 17 |
print('treading')
|
| 18 |
-
# os.system('
|
|
|
|
| 19 |
return 't1.start()'
|
| 20 |
|
| 21 |
@app.route('/')
|
|
@@ -43,11 +45,9 @@ if __name__=='__main__':
|
|
| 43 |
app.run(debug=True)
|
| 44 |
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
def threadserver():
|
| 49 |
print('hi')
|
| 50 |
-
|
| 51 |
|
| 52 |
|
| 53 |
# import requests
|
|
|
|
| 1 |
import os
|
| 2 |
from flask import Flask
|
| 3 |
+
import threading
|
| 4 |
|
| 5 |
|
| 6 |
API_URL = "https://api-inference.huggingface.co/models/sentence-transformers/all-MiniLM-L6-v2"
|
|
|
|
| 14 |
|
| 15 |
@app.route('/app')
|
| 16 |
def server_app():
|
| 17 |
+
t1 = threading.Thread(target=threadserver)
|
| 18 |
print('treading')
|
| 19 |
+
# os.system('./mxbai-embed-large-v1-f16.llamafile --server --nobrowser')
|
| 20 |
+
t1.start()
|
| 21 |
return 't1.start()'
|
| 22 |
|
| 23 |
@app.route('/')
|
|
|
|
| 45 |
app.run(debug=True)
|
| 46 |
|
| 47 |
|
|
|
|
|
|
|
| 48 |
def threadserver():
|
| 49 |
print('hi')
|
| 50 |
+
os.system(' ./mxbai-embed-large-v1-f16.llamafile --server --nobrowser')
|
| 51 |
|
| 52 |
|
| 53 |
# import requests
|