Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chain of Density Complex Example from Report #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ MNIST/*
log.txt
colabs/log.txt
artifacts
examples/jax/jax-llm/proteins-base/
examples/jax/jax-llm/proteins-base/
colabs/anthropic/.env
colabs/anthropic/summarization/.env
colabs/anthropic/media
1,348 changes: 1,348 additions & 0 deletions colabs/anthropic/summarization/ReadMe.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions colabs/anthropic/summarization/arxiv_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from pydantic import BaseModel
from typing import List, Optional
from datetime import datetime


class Author(BaseModel):
full_name: str


class Link(BaseModel):
href: str
title: Optional[str] = None
rel: Optional[str] = None
content_type: Optional[str] = None


class ArxivPaper(BaseModel):
entry_id: str
updated: datetime
published: datetime
title: str
authors: List[Author]
summary: str
comment: Optional[str] = None
journal_ref: Optional[str] = None
doi: Optional[str] = None
primary_category: str
categories: List[str]
links: List[Link]
pdf_url: Optional[str] = None

def __getitem__(self, key):
return getattr(self, key)


def convert_raw_arxiv_to_pydantic(paper):
return ArxivPaper(
entry_id=paper.entry_id,
updated=paper.updated,
published=paper.published,
title=paper.title,
authors=[Author(full_name=str(author)) for author in paper.authors],
summary=paper.summary,
comment=paper.comment,
journal_ref=paper.journal_ref,
doi=paper.doi,
primary_category=paper.primary_category,
categories=paper.categories,
links=[
Link(
href=link.href,
title=link.title,
rel=link.rel,
content_type=link.content_type,
)
for link in paper.links
],
pdf_url=paper.pdf_url,
)
Loading
Loading