abadesalex commited on
Commit
10f2c8a
1 Parent(s): 5386184

update url

Browse files
FastAPI/requirements.txt CHANGED
@@ -1,8 +1,4 @@
1
  uvicorn
2
  fastapi
3
  scipy==1.11.0
4
- gensim
5
-
6
- # gensim==4.0.1
7
- # scipy==1.7.3
8
- # numpy==1.19.5
 
1
  uvicorn
2
  fastapi
3
  scipy==1.11.0
4
+ gensim
 
 
 
 
my-app/src/Components/ActiveWords/index.jsx CHANGED
@@ -7,20 +7,20 @@ import EmbeddingPlot from "../Plot";
7
 
8
  export default function ActiveWords() {
9
  const [words, setWords] = useState([]);
10
- // const [embedding, setEmbedding] = useState([]);
11
 
12
  const fetchWords = async () => {
13
- const response = await fetch("http://localhost:8000/api/words");
 
 
 
14
  const wordsResponse = await response.json();
15
  setWords(wordsResponse.data);
16
-
17
- // console.log("response", wordsResponse.data);
18
- // console.log("words", words);
19
-
20
  };
21
 
22
  const deleteWord = async (id) => {
23
- await fetch(`http://localhost:8000/api/delete-word/${id}`, {
 
 
24
  method: "DELETE",
25
  headers: { "Content-Type": "application/json" },
26
  });
@@ -40,7 +40,7 @@ export default function ActiveWords() {
40
  <CreateWordEmbedding />
41
  </Grid>
42
  <Grid item>
43
- <EmbeddingPlot words={words}/>
44
  </Grid>
45
  </Grid>
46
  <Grid item xs={4}>
 
7
 
8
  export default function ActiveWords() {
9
  const [words, setWords] = useState([]);
 
10
 
11
  const fetchWords = async () => {
12
+ const url = `https://abadesalex-emb-rep.hf.space/api/words`;
13
+ // const url = "http://localhost:8000/api/words"
14
+
15
+ const response = await fetch(url);
16
  const wordsResponse = await response.json();
17
  setWords(wordsResponse.data);
 
 
 
 
18
  };
19
 
20
  const deleteWord = async (id) => {
21
+ const url = `https://abadesalex-emb-rep.hf.space/api/delete-word/${id}`;
22
+ // const url = `http://localhost:8000/api/delete-word/${id}`
23
+ await fetch(url, {
24
  method: "DELETE",
25
  headers: { "Content-Type": "application/json" },
26
  });
 
40
  <CreateWordEmbedding />
41
  </Grid>
42
  <Grid item>
43
+ <EmbeddingPlot words={words} />
44
  </Grid>
45
  </Grid>
46
  <Grid item xs={4}>
my-app/src/Components/CreateWord/CreateWord.jsx CHANGED
@@ -12,15 +12,14 @@ const CreateWordEmbedding = () => {
12
  };
13
 
14
  const onPressButton = () => {
15
- // const url = `https://abadesalex-emb-rep.hf.space/api/sum_of_lengths?word1=${wordOne}&word2=${wordTwo}`;
16
- // const url = `http://localhost:8000/api/sum_of_lengths?word1=${wordOne}`;
17
- const url2 = `http://localhost:8000/api/add-word`;
18
  const newWord = {
19
  id: words.length + 1,
20
  item: wordOne,
21
  };
22
-
23
- fetch(url2, {
24
  method: "POST",
25
  headers: {
26
  "Content-Type": "application/json",
 
12
  };
13
 
14
  const onPressButton = () => {
15
+ const url = `https://abadesalex-emb-rep.hf.space/api/add-word`;
16
+ // const url = `http://localhost:8000/api/add-word`;
 
17
  const newWord = {
18
  id: words.length + 1,
19
  item: wordOne,
20
  };
21
+
22
+ fetch(url, {
23
  method: "POST",
24
  headers: {
25
  "Content-Type": "application/json",