Skip to content

Commit

Permalink
Merge pull request #79 from Renumics/feature/example_llama
Browse files Browse the repository at this point in the history
Feature/example llama
  • Loading branch information
dani2112 authored Mar 4, 2025
2 parents b6341fb + 6706701 commit 0203b7d
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 262 deletions.
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

0 comments on commit 0203b7d

Please sign in to comment.