PadmasaliGovardhan commited on
Commit
f2219aa
·
1 Parent(s): 2ccfcbd

Json issue2

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -1
  2. app/main.py +3 -2
  3. frontend/script.js +1 -1
Dockerfile CHANGED
@@ -6,7 +6,8 @@ WORKDIR /code
6
  COPY app/requirements.txt /code/requirements.txt
7
  RUN pip install --no-cache-dir -r /code/requirements.txt
8
 
9
- COPY app /code/app
 
10
 
11
  # (Optional) Copy .env if needed
12
  # COPY .env /code/.env
 
6
  COPY app/requirements.txt /code/requirements.txt
7
  RUN pip install --no-cache-dir -r /code/requirements.txt
8
 
9
+ COPY frontend /code/frontend
10
+
11
 
12
  # (Optional) Copy .env if needed
13
  # COPY .env /code/.env
app/main.py CHANGED
@@ -1,14 +1,15 @@
1
  from dotenv import load_dotenv
2
  load_dotenv()
3
-
4
  from fastapi import FastAPI, UploadFile, Form, File
5
  from fastapi.middleware.cors import CORSMiddleware
6
  import fitz
7
  import os
8
 
 
9
  # keep package-relative import if this is inside app/
10
  from .rag_app import RAGApp
11
-
12
  app = FastAPI(title="Personal Assistant")
13
 
14
  # Initialize RagApp safely
 
1
  from dotenv import load_dotenv
2
  load_dotenv()
3
+ from fastapi.staticfiles import StaticFiles
4
  from fastapi import FastAPI, UploadFile, Form, File
5
  from fastapi.middleware.cors import CORSMiddleware
6
  import fitz
7
  import os
8
 
9
+
10
  # keep package-relative import if this is inside app/
11
  from .rag_app import RAGApp
12
+ app.mount("/", StaticFiles(directory="frontend", html=True), name="frontend")
13
  app = FastAPI(title="Personal Assistant")
14
 
15
  # Initialize RagApp safely
frontend/script.js CHANGED
@@ -1,4 +1,4 @@
1
- const backendURL = "http://127.0.0.1:8000"; // change if deployed
2
  const uploadBtn = document.getElementById("uploadBtn");
3
  const sendBtn = document.getElementById("sendBtn");
4
  const pdfInput = document.getElementById("pdfInput");
 
1
+ const backendURL = "https://gvadxx-ai-notebook-assistant-rag.hf.space"; // change if deployed
2
  const uploadBtn = document.getElementById("uploadBtn");
3
  const sendBtn = document.getElementById("sendBtn");
4
  const pdfInput = document.getElementById("pdfInput");