Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files- myinfer_latest.py +8 -1
myinfer_latest.py
CHANGED
|
@@ -101,6 +101,7 @@ if os.path.isfile("rmvpe.pt"):
|
|
| 101 |
|
| 102 |
|
| 103 |
|
|
|
|
| 104 |
def load_hubert():
|
| 105 |
global hubert_model
|
| 106 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
|
@@ -211,7 +212,13 @@ def download_file(filename):
|
|
| 211 |
|
| 212 |
return jsonify({'success': True, 'message': 'File downloaded successfully', 'file_path': local_file_path})
|
| 213 |
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
@app.route("/logout")
|
| 217 |
def logout():
|
|
|
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
+
|
| 105 |
def load_hubert():
|
| 106 |
global hubert_model
|
| 107 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
|
|
|
| 212 |
|
| 213 |
return jsonify({'success': True, 'message': 'File downloaded successfully', 'file_path': local_file_path})
|
| 214 |
|
| 215 |
+
@app.route('/list-weights', methods=['GET'])
|
| 216 |
+
def list_weights():
|
| 217 |
+
directory = 'weights'
|
| 218 |
+
files = os.listdir(directory)
|
| 219 |
+
# Extract filenames without their extensions
|
| 220 |
+
filenames = [os.path.splitext(file)[0] for file in files if os.path.isfile(os.path.join(directory, file))]
|
| 221 |
+
return jsonify(filenames)
|
| 222 |
|
| 223 |
@app.route("/logout")
|
| 224 |
def logout():
|