fixed id in postgres to use id of the paper instead of url
This commit is contained in:
parent
16eb77784e
commit
6a637bd7c4
76
check_deepseek.py
Normal file
76
check_deepseek.py
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import os
|
||||||
|
import asyncio
|
||||||
|
import aiohttp
|
||||||
|
import json
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
import platform
|
||||||
|
|
||||||
|
async def check_deepseek_api():
|
||||||
|
"""Simple check if Deepseek API is responsive."""
|
||||||
|
# Load API key from environment
|
||||||
|
load_dotenv()
|
||||||
|
api_key = os.getenv('DEEPSEEK_API_KEY')
|
||||||
|
if not api_key:
|
||||||
|
print("Error: DEEPSEEK_API_KEY not found in environment")
|
||||||
|
return False
|
||||||
|
|
||||||
|
session = None
|
||||||
|
try:
|
||||||
|
# Create session with auth header
|
||||||
|
session = aiohttp.ClientSession(headers={"Authorization": f"Bearer {api_key}"})
|
||||||
|
|
||||||
|
# Simple test request
|
||||||
|
payload = {
|
||||||
|
"model": "deepseek-chat",
|
||||||
|
"messages": [{"role": "user", "content": "Say hi and introduce yourself briefly"}],
|
||||||
|
"max_tokens": 100 # Increased to get full response
|
||||||
|
}
|
||||||
|
|
||||||
|
print("Testing Deepseek API...")
|
||||||
|
print("\nRequest:")
|
||||||
|
print(json.dumps(payload, indent=2))
|
||||||
|
|
||||||
|
async with session.post("https://api.deepseek.com/v1/chat/completions", json=payload) as response:
|
||||||
|
if response.status != 200:
|
||||||
|
print(f"\nError: API returned status {response.status}")
|
||||||
|
error_text = await response.text()
|
||||||
|
print(f"Response: {error_text}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
data = await response.json()
|
||||||
|
if not data or 'choices' not in data or not data['choices']:
|
||||||
|
print("\nError: Invalid response format")
|
||||||
|
print("Full Response:")
|
||||||
|
print(json.dumps(data, indent=2))
|
||||||
|
return False
|
||||||
|
|
||||||
|
print("\nSuccess! API is responding correctly")
|
||||||
|
print("\nFull Response:")
|
||||||
|
print(json.dumps(data, indent=2))
|
||||||
|
print("\nMessage Content:")
|
||||||
|
print(data['choices'][0]['message']['content'])
|
||||||
|
return True
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"\nError connecting to Deepseek API: {e}")
|
||||||
|
return False
|
||||||
|
finally:
|
||||||
|
if session:
|
||||||
|
await session.close()
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Set event loop policy for Windows
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||||
|
|
||||||
|
# Create new event loop
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
try:
|
||||||
|
loop.run_until_complete(check_deepseek_api())
|
||||||
|
finally:
|
||||||
|
loop.close()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
21
papers/2502_05115v1.json
Normal file
21
papers/2502_05115v1.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"title": "\"It Felt Like I Was Left in the Dark\": Exploring Information Needs and Design Opportunities for Family Caregivers of Older Adult Patients in Critical Care Settings",
|
||||||
|
"authors": [
|
||||||
|
"Shihan Fu",
|
||||||
|
"Bingsheng Yao",
|
||||||
|
"Smit Desai",
|
||||||
|
"Yuqi Hu",
|
||||||
|
"Yuling Sun",
|
||||||
|
"Samantha Stonbraker",
|
||||||
|
"Yanjun Gao",
|
||||||
|
"Elizabeth M. Goldberg",
|
||||||
|
"Dakuo Wang"
|
||||||
|
],
|
||||||
|
"abstract": "Older adult patients constitute a rapidly growing subgroup of Intensive Care\nUnit (ICU) patients. In these situations, their family caregivers are expected\nto represent the unconscious patients to access and interpret patients' medical\ninformation. However, caregivers currently have to rely on overloaded\nclinicians for information updates and typically lack the health literacy to\nunderstand complex medical information. Our project aims to explore the\ninformation needs of caregivers of ICU older adult patients, from which we can\npropose design opportunities to guide future AI systems. The project begins\nwith formative interviews with 11 caregivers to identify their challenges in\naccessing and interpreting medical information; From these findings, we then\nsynthesize design requirements and propose an AI system prototype to cope with\ncaregivers' challenges. The system prototype has two key features: a timeline\nvisualization to show the AI extracted and summarized older adult patients' key\nmedical events; and an LLM-based chatbot to provide context-aware informational\nsupport. We conclude our paper by reporting on the follow-up user evaluation of\nthe system and discussing future AI-based systems for ICU caregivers of older\nadults.",
|
||||||
|
"pdf_url": "http://arxiv.org/pdf/2502.05115v1",
|
||||||
|
"entry_id": "http://arxiv.org/abs/2502.05115v1",
|
||||||
|
"categories": [
|
||||||
|
"cs.HC",
|
||||||
|
"cs.AI"
|
||||||
|
]
|
||||||
|
}
|
||||||
21
papers/2502_06788v1.json
Normal file
21
papers/2502_06788v1.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"title": "EVEv2: Improved Baselines for Encoder-Free Vision-Language Models",
|
||||||
|
"authors": [
|
||||||
|
"Haiwen Diao",
|
||||||
|
"Xiaotong Li",
|
||||||
|
"Yufeng Cui",
|
||||||
|
"Yueze Wang",
|
||||||
|
"Haoge Deng",
|
||||||
|
"Ting Pan",
|
||||||
|
"Wenxuan Wang",
|
||||||
|
"Huchuan Lu",
|
||||||
|
"Xinlong Wang"
|
||||||
|
],
|
||||||
|
"abstract": "Existing encoder-free vision-language models (VLMs) are rapidly narrowing the\nperformance gap with their encoder-based counterparts, highlighting the\npromising potential for unified multimodal systems with structural simplicity\nand efficient deployment. We systematically clarify the performance gap between\nVLMs using pre-trained vision encoders, discrete tokenizers, and minimalist\nvisual layers from scratch, deeply excavating the under-examined\ncharacteristics of encoder-free VLMs. We develop efficient strategies for\nencoder-free VLMs that rival mainstream encoder-based ones. After an in-depth\ninvestigation, we launch EVEv2.0, a new and improved family of encoder-free\nVLMs. We show that: (i) Properly decomposing and hierarchically associating\nvision and language within a unified model reduces interference between\nmodalities. (ii) A well-designed training strategy enables effective\noptimization for encoder-free VLMs. Through extensive evaluation, our EVEv2.0\nrepresents a thorough study for developing a decoder-only architecture across\nmodalities, demonstrating superior data efficiency and strong vision-reasoning\ncapability. Code is publicly available at: https://github.com/baaivision/EVE.",
|
||||||
|
"pdf_url": "http://arxiv.org/pdf/2502.06788v1",
|
||||||
|
"entry_id": "http://arxiv.org/abs/2502.06788v1",
|
||||||
|
"categories": [
|
||||||
|
"cs.CV",
|
||||||
|
"cs.AI"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -92,6 +92,9 @@ class AgentController:
|
|||||||
# Store paper in databases
|
# Store paper in databases
|
||||||
paper_id = paper_data.get('entry_id') # Use entry_id from arXiv
|
paper_id = paper_data.get('entry_id') # Use entry_id from arXiv
|
||||||
if paper_id:
|
if paper_id:
|
||||||
|
# Extract just the ID part from the arXiv URL
|
||||||
|
paper_id = paper_id.split('/')[-1] # This will get "2502.06788v1" from "http://arxiv.org/abs/2502.06788v1"
|
||||||
|
|
||||||
logger.debug(f"Checking PostgreSQL for paper {paper_id}")
|
logger.debug(f"Checking PostgreSQL for paper {paper_id}")
|
||||||
existing = await self.paper_store.get_paper(paper_id)
|
existing = await self.paper_store.get_paper(paper_id)
|
||||||
if existing:
|
if existing:
|
||||||
@ -105,7 +108,7 @@ class AgentController:
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
# Clean paper_id to use as filename
|
# Clean paper_id to use as filename
|
||||||
safe_id = paper_id.split('/')[-1].replace('.', '_')
|
safe_id = paper_id.replace('.', '_')
|
||||||
|
|
||||||
# Save paper content to file
|
# Save paper content to file
|
||||||
paper_path = self.papers_dir / f"{safe_id}.json"
|
paper_path = self.papers_dir / f"{safe_id}.json"
|
||||||
@ -178,7 +181,7 @@ class AgentController:
|
|||||||
paper = await self.paper_store.get_paper(paper_id)
|
paper = await self.paper_store.get_paper(paper_id)
|
||||||
if paper:
|
if paper:
|
||||||
# Load full paper data if needed
|
# Load full paper data if needed
|
||||||
safe_id = paper_id.split('/')[-1].replace('.', '_')
|
safe_id = paper_id.replace('.', '_')
|
||||||
paper_path = self.papers_dir / f"{safe_id}.json"
|
paper_path = self.papers_dir / f"{safe_id}.json"
|
||||||
if paper_path.exists():
|
if paper_path.exists():
|
||||||
with open(paper_path, 'r', encoding='utf-8') as f:
|
with open(paper_path, 'r', encoding='utf-8') as f:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user