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

Feature/example llama #79

Merged
merged 8 commits into from
Mar 4, 2025
Merged
4 changes: 3 additions & 1 deletion examples/llama-index/backend/main_with_highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ def create_index_from_pdf(pdf_path):

# Usage Example
DATA_FOLDER = os.path.dirname(os.path.abspath(__file__)) + "/data"

print(f"found {len(list(Path(DATA_FOLDER).glob('*.pdf')))} pdf files in {DATA_FOLDER}")
# get the first pdf file in the data folder
pdf_path = str(Path(DATA_FOLDER).glob("*.pdf").__next__())
index = create_index_from_pdf(pdf_path)

# Query the Index
query_engine = index.as_query_engine()
query_engine = index.as_query_engine(similarity_top_k=10)

app = FastAPI()

Expand Down
7 changes: 5 additions & 2 deletions examples/llama-index/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 0 additions & 41 deletions examples/llama-index/frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,41 +0,0 @@
#root {
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
Loading
Loading