Spaces:
Runtime error
Runtime error
gmerrill
commited on
Commit
·
f99e419
1
Parent(s):
249be3f
update
Browse files- main.py +4 -3
- static/index.html +3 -2
main.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from fastapi import FastAPI,
|
| 2 |
from fastapi.staticfiles import StaticFiles
|
| 3 |
from fastapi.responses import FileResponse
|
| 4 |
|
|
@@ -7,8 +7,9 @@ from transformers import pipeline
|
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
@app.post("/query_gorilla")
|
| 10 |
-
def query_gorilla(req:
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 14 |
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Request
|
| 2 |
from fastapi.staticfiles import StaticFiles
|
| 3 |
from fastapi.responses import FileResponse
|
| 4 |
|
|
|
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
@app.post("/query_gorilla")
|
| 10 |
+
def query_gorilla(req: Request):
|
| 11 |
+
const json = await request.json()
|
| 12 |
+
return str(json)
|
| 13 |
|
| 14 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 15 |
|
static/index.html
CHANGED
|
@@ -19,7 +19,7 @@ Prompt:<br/>
|
|
| 19 |
|
| 20 |
{
|
| 21 |
query: "Call me an Uber ride type \"Plus\" in Berkeley at zipcode 94704 in 10 minutes",
|
| 22 |
-
|
| 23 |
{
|
| 24 |
"name": "Uber Carpool",
|
| 25 |
"api_name": "uber.ride",
|
|
@@ -30,7 +30,8 @@ Prompt:<br/>
|
|
| 30 |
{"name": "time", "description": "The amount of time in minutes the customer is willing to wait"}
|
| 31 |
]
|
| 32 |
}
|
| 33 |
-
]
|
|
|
|
| 34 |
|
| 35 |
</textarea>
|
| 36 |
<br/>
|
|
|
|
| 19 |
|
| 20 |
{
|
| 21 |
query: "Call me an Uber ride type \"Plus\" in Berkeley at zipcode 94704 in 10 minutes",
|
| 22 |
+
functions: [
|
| 23 |
{
|
| 24 |
"name": "Uber Carpool",
|
| 25 |
"api_name": "uber.ride",
|
|
|
|
| 30 |
{"name": "time", "description": "The amount of time in minutes the customer is willing to wait"}
|
| 31 |
]
|
| 32 |
}
|
| 33 |
+
]
|
| 34 |
+
}
|
| 35 |
|
| 36 |
</textarea>
|
| 37 |
<br/>
|