32 lines
625 B
Elixir
32 lines
625 B
Elixir
import Config
|
|
|
|
env_file = ".env"
|
|
|
|
if File.exists?(env_file) do
|
|
File.read!(env_file)
|
|
|> String.split("\n", trim: true)
|
|
|> Enum.each(fn line ->
|
|
case String.split(line, "=", parts: 2) do
|
|
[key, value] -> System.put_env(String.trim(key), String.trim(value))
|
|
_ -> :ok
|
|
end
|
|
end)
|
|
else
|
|
IO.puts("Warning: #{env_file} not found.")
|
|
end
|
|
|
|
# Configuración EXLA y Nx
|
|
config :exla,
|
|
clients: [
|
|
cuda: [
|
|
platform: :host,
|
|
default_device_id: 0,
|
|
preallocate: false,
|
|
memory_fraction: 0.5
|
|
],
|
|
host: [platform: :host]
|
|
]
|
|
|
|
config :nx,
|
|
default_backend: {EXLA.Backend, client: :cuda}
|