Spaces:
Runtime error
Runtime error
Fix port
Browse files- README.md +1 -1
- react-qa/build/asset-manifest.json +3 -3
- react-qa/build/index.html +1 -1
- react-qa/build/static/js/main.beff4215.js +0 -0
- react-qa/build/static/js/main.beff4215.js.LICENSE.txt +0 -54
- react-qa/build/static/js/main.beff4215.js.map +0 -0
- react-qa/src/App.js +1 -1
- app.py β server.py +1 -3
- start.py +4 -0
README.md
CHANGED
@@ -5,7 +5,7 @@ colorFrom: indigo
|
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.4
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
---
|
11 |
|
|
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.4
|
8 |
+
app_file: start.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
react-qa/build/asset-manifest.json
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
{
|
2 |
"files": {
|
3 |
"main.css": "/static/css/main.94510c01.css",
|
4 |
-
"main.js": "/static/js/main.
|
5 |
"static/js/787.e7ee5088.chunk.js": "/static/js/787.e7ee5088.chunk.js",
|
6 |
"index.html": "/index.html",
|
7 |
"main.94510c01.css.map": "/static/css/main.94510c01.css.map",
|
8 |
-
"main.
|
9 |
"787.e7ee5088.chunk.js.map": "/static/js/787.e7ee5088.chunk.js.map"
|
10 |
},
|
11 |
"entrypoints": [
|
12 |
"static/css/main.94510c01.css",
|
13 |
-
"static/js/main.
|
14 |
]
|
15 |
}
|
|
|
1 |
{
|
2 |
"files": {
|
3 |
"main.css": "/static/css/main.94510c01.css",
|
4 |
+
"main.js": "/static/js/main.c7d487d5.js",
|
5 |
"static/js/787.e7ee5088.chunk.js": "/static/js/787.e7ee5088.chunk.js",
|
6 |
"index.html": "/index.html",
|
7 |
"main.94510c01.css.map": "/static/css/main.94510c01.css.map",
|
8 |
+
"main.c7d487d5.js.map": "/static/js/main.c7d487d5.js.map",
|
9 |
"787.e7ee5088.chunk.js.map": "/static/js/787.e7ee5088.chunk.js.map"
|
10 |
},
|
11 |
"entrypoints": [
|
12 |
"static/css/main.94510c01.css",
|
13 |
+
"static/js/main.c7d487d5.js"
|
14 |
]
|
15 |
}
|
react-qa/build/index.html
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.
|
|
|
1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.c7d487d5.js"></script><link href="/static/css/main.94510c01.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
react-qa/build/static/js/main.beff4215.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
react-qa/build/static/js/main.beff4215.js.LICENSE.txt
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
object-assign
|
3 |
-
(c) Sindre Sorhus
|
4 |
-
@license MIT
|
5 |
-
*/
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @license React
|
9 |
-
* react-dom.production.min.js
|
10 |
-
*
|
11 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
12 |
-
*
|
13 |
-
* This source code is licensed under the MIT license found in the
|
14 |
-
* LICENSE file in the root directory of this source tree.
|
15 |
-
*/
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @license React
|
19 |
-
* react-jsx-runtime.production.min.js
|
20 |
-
*
|
21 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
22 |
-
*
|
23 |
-
* This source code is licensed under the MIT license found in the
|
24 |
-
* LICENSE file in the root directory of this source tree.
|
25 |
-
*/
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @license React
|
29 |
-
* react.production.min.js
|
30 |
-
*
|
31 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
32 |
-
*
|
33 |
-
* This source code is licensed under the MIT license found in the
|
34 |
-
* LICENSE file in the root directory of this source tree.
|
35 |
-
*/
|
36 |
-
|
37 |
-
/**
|
38 |
-
* @license React
|
39 |
-
* scheduler.production.min.js
|
40 |
-
*
|
41 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
42 |
-
*
|
43 |
-
* This source code is licensed under the MIT license found in the
|
44 |
-
* LICENSE file in the root directory of this source tree.
|
45 |
-
*/
|
46 |
-
|
47 |
-
/** @license React v17.0.2
|
48 |
-
* react.production.min.js
|
49 |
-
*
|
50 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
51 |
-
*
|
52 |
-
* This source code is licensed under the MIT license found in the
|
53 |
-
* LICENSE file in the root directory of this source tree.
|
54 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
react-qa/build/static/js/main.beff4215.js.map
DELETED
The diff for this file is too large to render.
See raw diff
|
|
react-qa/src/App.js
CHANGED
@@ -9,7 +9,7 @@ function App() {
|
|
9 |
const [context,set_context] = useState("My name is Clara and I live in Berkeley.")
|
10 |
|
11 |
let request_qa_data = () => {
|
12 |
-
axios.post('http://127.0.0.1:
|
13 |
question,
|
14 |
context
|
15 |
})
|
|
|
9 |
const [context,set_context] = useState("My name is Clara and I live in Berkeley.")
|
10 |
|
11 |
let request_qa_data = () => {
|
12 |
+
axios.post('http://127.0.0.1:7860/question-answer',{
|
13 |
question,
|
14 |
context
|
15 |
})
|
app.py β server.py
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
from fastapi.middleware.cors import CORSMiddleware
|
2 |
from fastapi import FastAPI
|
3 |
-
|
4 |
from fastapi.responses import HTMLResponse
|
5 |
from fastapi.staticfiles import StaticFiles
|
6 |
from transformer_qa_decode import TransformerQADecode
|
@@ -46,5 +46,3 @@ def read_item(item:QAItem):
|
|
46 |
r[i] = x_dict
|
47 |
return result
|
48 |
|
49 |
-
if __name__ == "__main__":
|
50 |
-
uvicorn.run("app:app",port=7680,reload=True)
|
|
|
1 |
from fastapi.middleware.cors import CORSMiddleware
|
2 |
from fastapi import FastAPI
|
3 |
+
|
4 |
from fastapi.responses import HTMLResponse
|
5 |
from fastapi.staticfiles import StaticFiles
|
6 |
from transformer_qa_decode import TransformerQADecode
|
|
|
46 |
r[i] = x_dict
|
47 |
return result
|
48 |
|
|
|
|
start.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
subprocess.run("uvicorn server:app --host 0.0.0.0 --port 7860", shell=True)
|
4 |
+
|