Spaces:
Running
Running
--- | |
title: "Open Source Cookbook" | |
--- | |
This is a Quarto implementation of [the Open-Source AI Cookbook](https://github.com/huggingface/cookbook), | |
which is a collection of notebooks illustrating practical aspects of building AI | |
applications and solving various machine learning tasks using open-source tools and models. | |
# About Quarto | |
[Quarto](https://quarto.org/) is a Markdown-based documentation system which lets you write documents in Markdown or Jupyter Notebooks, and render them to a variety of formats including HTML, PDF, Powerpoint, and more. | |
You can also use Quarto to write [books](https://quarto.org/docs/books/), create [dashboards](https://quarto.org/docs/dashboards/), and embed web applications with [Observable](https://quarto.org/docs/interactive/ojs/) and [Shinylive](https://quarto.org/docs/blog/posts/2022-10-25-shinylive-extension/). | |
## Executing code | |
One of the main virtues of Quarto is that it lets you combine code and text in a single document. | |
By default if you include a code chunk in your document, Quarto will execute that code and include the output in the rendered document. | |
This is great for reproducibility and for creating documents that are always up-to-date. | |
For example you can include code which generates a plot like this: | |
```{python} | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
# Sample data | |
tips = sns.load_dataset("tips") | |
# Create a seaborn plot | |
sns.set_style("whitegrid") | |
g = sns.lmplot(x="total_bill", y="tip", data=tips, aspect=2) | |
g = g.set_axis_labels("Total bill (USD)", "Tip").set(xlim=(0, 60), ylim=(0, 12)) | |
plt.title("Tip by Total Bill") | |
plt.show() | |
``` | |
You can also include [inline code](https://quarto.org/docs/computations/inline-code.html) to insert computed values into text. | |
For example we can reference the `tips` data frame which was defined in the preceding code block by wrapping it in ``{python} tips['tip'].max()``. | |
The ouput of the inline code in inte `{python} tips['tip'].max()`. You can control [code execution](https://quarto.org/docs/computations/execution-options.html), or [freeze code output](https://quarto.org/docs/projects/code-execution.html#freeze) to capture the output of long running computations. |