Spaces:
Runtime error
Runtime error
Update
Browse files- react-qa/build/asset-manifest.json +3 -3
- react-qa/build/index.html +1 -1
- react-qa/build/static/js/{main.2f618c79.js β main.8ed150af.js} +0 -0
- react-qa/build/static/js/{main.2f618c79.js.LICENSE.txt β main.8ed150af.js.LICENSE.txt} +0 -0
- react-qa/build/static/js/{main.2f618c79.js.map β main.8ed150af.js.map} +0 -0
- react-qa/src/App.js +4 -8
react-qa/build/asset-manifest.json
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
{
|
2 |
"files": {
|
3 |
"main.css": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/css/main.94510c01.css",
|
4 |
-
"main.js": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/main.
|
5 |
"static/js/787.e7ee5088.chunk.js": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/787.e7ee5088.chunk.js",
|
6 |
"index.html": "/embed/p208p2002/Transformer-QA-Decode-Visualize/index.html",
|
7 |
"main.94510c01.css.map": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/css/main.94510c01.css.map",
|
8 |
-
"main.
|
9 |
"787.e7ee5088.chunk.js.map": "/embed/p208p2002/Transformer-QA-Decode-Visualize/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": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/css/main.94510c01.css",
|
4 |
+
"main.js": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/main.8ed150af.js",
|
5 |
"static/js/787.e7ee5088.chunk.js": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/787.e7ee5088.chunk.js",
|
6 |
"index.html": "/embed/p208p2002/Transformer-QA-Decode-Visualize/index.html",
|
7 |
"main.94510c01.css.map": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/css/main.94510c01.css.map",
|
8 |
+
"main.8ed150af.js.map": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/main.8ed150af.js.map",
|
9 |
"787.e7ee5088.chunk.js.map": "/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/787.e7ee5088.chunk.js.map"
|
10 |
},
|
11 |
"entrypoints": [
|
12 |
"static/css/main.94510c01.css",
|
13 |
+
"static/js/main.8ed150af.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="/embed/p208p2002/Transformer-QA-Decode-Visualize/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="/embed/p208p2002/Transformer-QA-Decode-Visualize/logo192.png"/><link rel="manifest" href="/embed/p208p2002/Transformer-QA-Decode-Visualize/manifest.json"/><title>React App</title><script defer="defer" src="/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/main.
|
|
|
1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/embed/p208p2002/Transformer-QA-Decode-Visualize/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="/embed/p208p2002/Transformer-QA-Decode-Visualize/logo192.png"/><link rel="manifest" href="/embed/p208p2002/Transformer-QA-Decode-Visualize/manifest.json"/><title>React App</title><script defer="defer" src="/embed/p208p2002/Transformer-QA-Decode-Visualize/static/js/main.8ed150af.js"></script><link href="/embed/p208p2002/Transformer-QA-Decode-Visualize/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.2f618c79.js β main.8ed150af.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
react-qa/build/static/js/{main.2f618c79.js.LICENSE.txt β main.8ed150af.js.LICENSE.txt}
RENAMED
File without changes
|
react-qa/build/static/js/{main.2f618c79.js.map β main.8ed150af.js.map}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
react-qa/src/App.js
CHANGED
@@ -8,15 +8,15 @@ function App() {
|
|
8 |
const [question, set_question] = useState("What's my name?")
|
9 |
const [context, set_context] = useState("My name is Clara and I live in Berkeley.")
|
10 |
|
11 |
-
let request_qa_data = () => {
|
12 |
const { REACT_APP_IN_DEV = 'false' } = process.env;
|
13 |
let api_url = 'https://hf.space/embed/p208p2002/Transformer-QA-Decode-Visualize/question-answer'
|
14 |
if (REACT_APP_IN_DEV === 'true') {
|
15 |
api_url = 'http://127.0.0.1:7860/question-answer'
|
16 |
}
|
17 |
axios.post(api_url, {
|
18 |
-
question,
|
19 |
-
context
|
20 |
})
|
21 |
.then(function (response) {
|
22 |
console.log(response.data)
|
@@ -34,11 +34,7 @@ function App() {
|
|
34 |
value={question}
|
35 |
onChange={(e) => {
|
36 |
set_question(e.target.value)
|
37 |
-
|
38 |
-
setTimeout(() => {
|
39 |
-
request_qa_data()
|
40 |
-
}, 20);
|
41 |
-
|
42 |
}}
|
43 |
/>
|
44 |
<br />
|
|
|
8 |
const [question, set_question] = useState("What's my name?")
|
9 |
const [context, set_context] = useState("My name is Clara and I live in Berkeley.")
|
10 |
|
11 |
+
let request_qa_data = (e,_question=question,_context=context) => {
|
12 |
const { REACT_APP_IN_DEV = 'false' } = process.env;
|
13 |
let api_url = 'https://hf.space/embed/p208p2002/Transformer-QA-Decode-Visualize/question-answer'
|
14 |
if (REACT_APP_IN_DEV === 'true') {
|
15 |
api_url = 'http://127.0.0.1:7860/question-answer'
|
16 |
}
|
17 |
axios.post(api_url, {
|
18 |
+
question:_question,
|
19 |
+
context:_context
|
20 |
})
|
21 |
.then(function (response) {
|
22 |
console.log(response.data)
|
|
|
34 |
value={question}
|
35 |
onChange={(e) => {
|
36 |
set_question(e.target.value)
|
37 |
+
request_qa_data(e,e.target.value)
|
|
|
|
|
|
|
|
|
38 |
}}
|
39 |
/>
|
40 |
<br />
|