Spaces:
Sleeping
Sleeping
deveix
commited on
Commit
·
e1967ee
1
Parent(s):
3152c36
fix app
Browse files- app/main.py +2 -12
- requirements.txt +1 -3
app/main.py
CHANGED
|
@@ -83,6 +83,8 @@ vector_search = MongoDBAtlasVectorSearch.from_connection_string(
|
|
| 83 |
index_name=ATLAS_VECTOR_SEARCH_INDEX_NAME,
|
| 84 |
)
|
| 85 |
|
|
|
|
|
|
|
| 86 |
|
| 87 |
# FastAPI application setup
|
| 88 |
app = FastAPI()
|
|
@@ -113,18 +115,6 @@ def index_file(filepath):
|
|
| 113 |
|
| 114 |
return index
|
| 115 |
|
| 116 |
-
# async def get_ayah_info(ayah):
|
| 117 |
-
# """Asynchronously fetches Ayah information from the Al-Quran API."""
|
| 118 |
-
# url = f"https://api.alquran.cloud/v1/search/{ayah}/all/ar"
|
| 119 |
-
# async with httpx.AsyncClient() as client:
|
| 120 |
-
# response = await client.get(url)
|
| 121 |
-
# if response.status_code == 200:
|
| 122 |
-
# return response.json()
|
| 123 |
-
# else:
|
| 124 |
-
# return {"error": "Failed to fetch data"}
|
| 125 |
-
|
| 126 |
-
df = pd.read_csv('app/quran.csv')
|
| 127 |
-
|
| 128 |
def get_text_by_block_number(filepath, block_numbers):
|
| 129 |
""" Retrieve specific blocks from a file based on block numbers, where each block is separated by '\n\n'. """
|
| 130 |
blocks_text = []
|
|
|
|
| 83 |
index_name=ATLAS_VECTOR_SEARCH_INDEX_NAME,
|
| 84 |
)
|
| 85 |
|
| 86 |
+
df = pd.read_csv('app/quran.csv')
|
| 87 |
+
|
| 88 |
|
| 89 |
# FastAPI application setup
|
| 90 |
app = FastAPI()
|
|
|
|
| 115 |
|
| 116 |
return index
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
def get_text_by_block_number(filepath, block_numbers):
|
| 119 |
""" Retrieve specific blocks from a file based on block numbers, where each block is separated by '\n\n'. """
|
| 120 |
blocks_text = []
|
requirements.txt
CHANGED
|
@@ -19,6 +19,4 @@ matplotlib
|
|
| 19 |
python-multipart
|
| 20 |
ffmpeg-python
|
| 21 |
noisereduce
|
| 22 |
-
scikit-learn==1.2.2
|
| 23 |
-
# httpx
|
| 24 |
-
pandas
|
|
|
|
| 19 |
python-multipart
|
| 20 |
ffmpeg-python
|
| 21 |
noisereduce
|
| 22 |
+
scikit-learn==1.2.2
|
|
|
|
|
|