Skip to content

Commit

Permalink
Merge pull request #50 from pcwerk/hf_dropdown
Browse files Browse the repository at this point in the history
Hf dropdown
  • Loading branch information
ArtxRod17 authored May 2, 2024
2 parents bffa0a9 + 93da6be commit 4b8f446
Show file tree
Hide file tree
Showing 13,288 changed files with 57 additions and 2,228,857 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 25 additions & 0 deletions backend/routes/langchainCallRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,29 @@ langchainCallRoute.post("/updateTokenLimit", async (req, res) => {
}
});

//Endpoint for HuggingFaceSQLCAll
langchainCallRoute.post("/askhf", async (req, res) => {
//call fastapi from this endpoint
try {
//get user input
const userInput = req.body.data;

//make request to fastapi server
const fastResponse = await axios.post(
"http://langchain:8000/hfprocesstext",
{
human_input: userInput,
}
);

//response from fastapi
const dataFromFastapi = fastResponse.data;

res.json({ message: "Successful call to FastAPI", dataFromFastapi });
} catch (error) {
console.error("Error calling FastAPI", error);
res.status(500).json({ error: "Failed to call FastAPI" });
}
});

export default langchainCallRoute;
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3.8'
version: "3.8"

services:

frontend:
container_name: lp-toolkit-frontend
build:
Expand Down Expand Up @@ -42,6 +41,7 @@ services:
- ./langchain/app:/usr/src/app
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
restart: unless-stopped
networks:
- express-mongo
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const chatOptionsData = [
title: "Hugging Face",
message: "Leverage Hugging Face models for diverse AI tasks.",
image: huggingfaceIcon,
apiEndpoint: "http://localhost:5050/huggingFaceCallRoute/ask",
apiEndpoint: "http://localhost:5050/langchainCallRoute/askhf",
},
];

Expand Down
247 changes: 0 additions & 247 deletions huggingface/.venv/bin/Activate.ps1

This file was deleted.

69 changes: 0 additions & 69 deletions huggingface/.venv/bin/activate

This file was deleted.

Loading

0 comments on commit 4b8f446

Please sign in to comment.