Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,6 @@ from gpt_researcher import GPTResearcher
|
|
| 3 |
import asyncio
|
| 4 |
import nest_asyncio
|
| 5 |
import os
|
| 6 |
-
from concurrent.futures import ThreadPoolExecutor
|
| 7 |
-
import threading
|
| 8 |
|
| 9 |
# Access secrets
|
| 10 |
openai_api_key = st.secrets["OPENAI_API_KEY"]
|
|
@@ -19,9 +17,6 @@ os.environ["DOC_PATH"] = "./local" # Path to the folder with documents
|
|
| 19 |
# Constants
|
| 20 |
REPORT_TYPE = "research_report"
|
| 21 |
|
| 22 |
-
# ThreadPoolExecutor to handle asynchronous tasks
|
| 23 |
-
executor = ThreadPoolExecutor(max_workers=16) # Adjust the number of workers as needed
|
| 24 |
-
|
| 25 |
|
| 26 |
# Define the asynchronous function to fetch the report
|
| 27 |
async def fetch_report(query, report_type):
|
|
|
|
| 3 |
import asyncio
|
| 4 |
import nest_asyncio
|
| 5 |
import os
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Access secrets
|
| 8 |
openai_api_key = st.secrets["OPENAI_API_KEY"]
|
|
|
|
| 17 |
# Constants
|
| 18 |
REPORT_TYPE = "research_report"
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Define the asynchronous function to fetch the report
|
| 22 |
async def fetch_report(query, report_type):
|