Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -22,8 +22,8 @@ headers = {"Authorization": bearer }
|
|
22 |
app = Flask(__name__)
|
23 |
|
24 |
@app.route('/')
|
25 |
-
def command_app():
|
26 |
-
res = tool.run("Obama's first name?")
|
27 |
|
28 |
payload ={
|
29 |
"inputs": {
|
@@ -32,9 +32,12 @@ def command_app():
|
|
32 |
"That is a happy dog",
|
33 |
"That is a very happy person",
|
34 |
"Today is a sunny day"]},}
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
@app.route('/app')
|
40 |
def command_server():
|
|
|
22 |
app = Flask(__name__)
|
23 |
|
24 |
@app.route('/')
|
25 |
+
async def command_app():
|
26 |
+
res = await tool.run("Obama's first name?")
|
27 |
|
28 |
payload ={
|
29 |
"inputs": {
|
|
|
32 |
"That is a happy dog",
|
33 |
"That is a very happy person",
|
34 |
"Today is a sunny day"]},}
|
35 |
+
|
36 |
+
print(payload)
|
37 |
+
print(res)
|
38 |
+
response = await requests.post(API_URL, headers=headers, json=payload)
|
39 |
+
print(response)
|
40 |
+
return response.json()
|
41 |
|
42 |
@app.route('/app')
|
43 |
def command_server():
|