Spaces:
Running
Running
Revert queue config and adjust API timeout
Browse files- app.py +1 -1
- pragent/backend/agents.py +1 -1
app.py
CHANGED
|
@@ -452,7 +452,7 @@ ACTIVATE_CAROUSEEL_JS = '''
|
|
| 452 |
'''
|
| 453 |
|
| 454 |
with gr.Blocks(theme=gr.themes.Soft(), css=CUSTOM_CSS) as demo:
|
| 455 |
-
demo.queue(
|
| 456 |
gr.Markdown("# 🚀 PRAgent: Paper to Social Media Post")
|
| 457 |
gr.Markdown("Upload a research paper PDF, and I will generate a social media post for Twitter or Xiaohongshu, complete with images and platform-specific styling.")
|
| 458 |
|
|
|
|
| 452 |
'''
|
| 453 |
|
| 454 |
with gr.Blocks(theme=gr.themes.Soft(), css=CUSTOM_CSS) as demo:
|
| 455 |
+
demo.queue()
|
| 456 |
gr.Markdown("# 🚀 PRAgent: Paper to Social Media Post")
|
| 457 |
gr.Markdown("Upload a research paper PDF, and I will generate a social media post for Twitter or Xiaohongshu, complete with images and platform-specific styling.")
|
| 458 |
|
pragent/backend/agents.py
CHANGED
|
@@ -25,7 +25,7 @@ async def setup_client(api_key: str, base_url: str) -> AsyncIterator[AsyncOpenAI
|
|
| 25 |
|
| 26 |
try:
|
| 27 |
tqdm.write("[*] 正在初始化API客户端...")
|
| 28 |
-
client = AsyncOpenAI(api_key=api_key, base_url=base_url, timeout=
|
| 29 |
yield client
|
| 30 |
except Exception as e:
|
| 31 |
tqdm.write(f"[!] 初始化AsyncOpenAI客户端时出错: {e}")
|
|
|
|
| 25 |
|
| 26 |
try:
|
| 27 |
tqdm.write("[*] 正在初始化API客户端...")
|
| 28 |
+
client = AsyncOpenAI(api_key=api_key, base_url=base_url, timeout=280.0)
|
| 29 |
yield client
|
| 30 |
except Exception as e:
|
| 31 |
tqdm.write(f"[!] 初始化AsyncOpenAI客户端时出错: {e}")
|