Update main.py
Browse files
main.py
CHANGED
@@ -2,7 +2,7 @@ import os, json, logging
|
|
2 |
import requests
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
from flask import Flask, request
|
6 |
app=Flask(__name__)
|
7 |
@app.route("/")
|
8 |
def hello():
|
@@ -27,7 +27,7 @@ api=HfApi()
|
|
27 |
def search():
|
28 |
args=request.args.to_dict()
|
29 |
models = api.list_models(**args)
|
30 |
-
return models
|
31 |
|
32 |
@app.route("/task_list")
|
33 |
def tasks():
|
|
|
2 |
import requests
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
from flask import Flask, request, jsonify
|
6 |
app=Flask(__name__)
|
7 |
@app.route("/")
|
8 |
def hello():
|
|
|
27 |
def search():
|
28 |
args=request.args.to_dict()
|
29 |
models = api.list_models(**args)
|
30 |
+
return jsonify(models)
|
31 |
|
32 |
@app.route("/task_list")
|
33 |
def tasks():
|