# FAQs

## Can I train a model locally?

Yes, but you should still include the code in case we need to rerun your work.

We understand that training some models requires significant resources and computing time, which cannot easily fit within the weekly quota. Some models even require a network connection that is not available in the cloud environment.

For these models, we recommend training locally but including the training code in a separate file or commenting it out.

If you do not submit your training code, you [might miss the opportunity](#user-content-fn-1)[^1] to retrain with more data during the [Out-of-Sample Phase](/other/glossary.md#out-of-sample-phase), as we have done in past competitions.

## `SCIPY_ARRAY_API`

As this flag introduces changes that could be changed in the future and was only intended as a [temporary measure](https://docs.scipy.org/doc/scipy/dev/api-dev/array_api.html), you need to enable it manually.

To achieve this, insert this cell before the one that imports SciPy for the first time.

{% code title="Python Notebook Cell" expandable="true" %}

```python
import os
os.environ["SCIPY_ARRAY_API"] = "1"
```

{% endcode %}

## How can I get the output of a Run?

Files generated in the cloud environment (e.g., trained models) cannot be extracted or downloaded locally.

This ensures that data accessible only there cannot be exfiltrated.

## I get a `NameError` on my constant

If you receive the following error:

<pre><code><strong>NameError: name ‘MY_CONSTANT’ is not defined
</strong></code></pre>

This happened because your constant was commented out during the submission process. You can avoid this by doing one of the following:

* Use the `# @crunch/keep:on` and `# @crunch/keep:off` commands to wrap the declaration of your constant:

{% code title="Python Notebook Cell" %}

```python
# @crunch/keep:on
MY_CONSTANT = true
# @crunch/keep:off

if MY_CONSTANT:
    ...
```

{% endcode %}

* Move your constants into a dedicated cell, then place `# @crunch/keep:on` at the very top:

{% code title="Python Notebook Cell" %}

```python
# @crunch/keep:on
MY_CONSTANT = true
```

{% endcode %}

{% code title="Python Notebook Cell" %}

```python
if MY_CONSTANT:
    ...
```

{% endcode %}

* Declare them in a class:

{% code title="Python Notebook Cell" %}

```python
class Constants:
    MY_CONSTANT = true

if Constants.MY_CONSTANT:
    ...
```

{% endcode %}

For more details, see [the Notebook Processor page](/competitions/participate/notebook-processor.md#automatic-line-commenting).

[^1]: They can be decided late in the competition.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.crunchdao.com/competitions/faqs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
