Skip to content

Commit 4bb0f12

Browse files
committed
Merge branch 'sameer'
2 parents 83a2df5 + d9020f8 commit 4bb0f12

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

Backend/Generate_qns.py

Whitespace-only changes.
607 Bytes
Binary file not shown.

Backend/cluster_qns.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from fastapi import APIRouter, Response
2+
from pathlib import Path
3+
4+
router = APIRouter()
5+
6+
@router.get("/clusterqns")
7+
async def generate_file():
8+
# Read the content of the file from local storage
9+
file_path = "Local_Storage/Generated_Files/cluster_questions.txt" # Replace with the actual path to your local file
10+
with open(file_path, "r") as file:
11+
file_content = file.read()
12+
13+
# Set the response to download the file
14+
return Response(content=file_content, media_type="text/plain")

Backend/pyqsorter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pyqsorter , sorts set of pyqs into modules
2-
from fastapi import APIRouter
2+
from fastapi import APIRouter, Response
33
import os
44
import re
55
import chardet
@@ -9,6 +9,7 @@
99
from sklearnex import patch_sklearn
1010
patch_sklearn()
1111
from sklearn.cluster import KMeans
12+
from pathlib import path
1213

1314

1415

Python_Code/Generate_qns.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55

66

77
# Define your input parameters
8-
with open('#define path sorted questions here', 'r') as file:
9-
sorted_questions = str(file.read())
10-
with open('#define path notebook questions here', 'r') as file:
11-
notebook_questions = str(file.read())
8+
with open('Local_Storage/Generated_Files/cluster_questions.txt', 'r') as file:
9+
sorted_questions = str(file.read())
1210
with open('#define path for important topics here', 'r') as file:
1311
important_topics = str(file.read())
14-
with open('#define path for reference paper here', 'r', encoding='latin-1') as file:
12+
with open('Local_Storage/pyqs_text', 'r', encoding='latin-1') as file:
1513
reference_paper = str(file.read())
1614

1715

main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
#from Backend.pyqsorter import router as api1_router
66
#from Backend.summariser import router_summariser as summariser
77
#from Backend.Notes_Analyser import router as api4_router
8-
#from Backend.speech_text import router as api5_router
9-
#from Backend.Narrator import router as narrator_router
10-
#from Backend.texttoAIvideo import router as api6_router
11-
from Backend.NotesToText import router as notestotext
8+
#from Backend.Narrator import router as api5_router
9+
from Backend.NotesToText import router as NotesToText_rounter
1210
# import other API routers as needed
1311

1412
origins = ["*"]
@@ -34,6 +32,9 @@
3432

3533
# include other API routers as needed
3634

35+
#app.include_router(NotesToText_rounter)
36+
app.include_router(cluster_qns_app)
37+
3738
if __name__ == "__main__":
3839
uvicorn.run(app, host="192.168.137.193", port=8000)
3940

0 commit comments

Comments
 (0)