Update main.py
Browse files
main.py
CHANGED
@@ -41,15 +41,13 @@ def run_task_model():
|
|
41 |
pipe=pipeline(task, model=f'{user}/{model}', **kargs)
|
42 |
return pipe(input)
|
43 |
|
44 |
-
|
|
|
45 |
@app.route("/search")
|
46 |
def search():
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
headers={"Authorization":f"Bearer {os.environ.get("token")}"}
|
51 |
-
)
|
52 |
-
return response
|
53 |
|
54 |
@app.route("/task_list")
|
55 |
def tasks():
|
|
|
41 |
pipe=pipeline(task, model=f'{user}/{model}', **kargs)
|
42 |
return pipe(input)
|
43 |
|
44 |
+
from huggingface_hub import HfApi
|
45 |
+
api=HfApi()
|
46 |
@app.route("/search")
|
47 |
def search():
|
48 |
+
args=request.args.to_dict()
|
49 |
+
models = api.list_models(**args)
|
50 |
+
return models
|
|
|
|
|
|
|
51 |
|
52 |
@app.route("/task_list")
|
53 |
def tasks():
|