Spaces:
Runtime error
Runtime error
Laura Cabayol Garcia
commited on
Commit
Β·
14f20e4
1
Parent(s):
37eb1ba
modify readme and app for HF
Browse files
README.md
CHANGED
@@ -1,12 +1,19 @@
|
|
|
|
1 |
---
|
2 |
title: Photo-z predictor
|
3 |
emoji: π
|
4 |
colorFrom: blue
|
5 |
colorTo: red
|
6 |
sdk: docker
|
7 |
-
python_version: 3.
|
8 |
pinned: false
|
9 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
This repository contains a neural network to predict photometric redshifts. The neural network incorporates domain adaptation, a methodology to mitigate the impact of sample bias in the spectroscopic training samples.
|
12 |
|
|
|
1 |
+
<!--
|
2 |
---
|
3 |
title: Photo-z predictor
|
4 |
emoji: π
|
5 |
colorFrom: blue
|
6 |
colorTo: red
|
7 |
sdk: docker
|
8 |
+
python_version: 3.11
|
9 |
pinned: false
|
10 |
---
|
11 |
+
-->
|
12 |
+
|
13 |
+
[](https://github.com/lauracabayol/TEMPS/actions)
|
14 |
+
[](https://github.com/pre-commit/pre-commit)
|
15 |
+
[](https://huggingface.co/spaces/lauracabayol/TEMPS)
|
16 |
+
[](https://github.com/lauracabayol/TEMPS/actions)
|
17 |
|
18 |
This repository contains a neural network to predict photometric redshifts. The neural network incorporates domain adaptation, a methodology to mitigate the impact of sample bias in the spectroscopic training samples.
|
19 |
|
app.py
CHANGED
@@ -1,15 +1,12 @@
|
|
1 |
from __future__ import annotations
|
2 |
import argparse
|
3 |
import logging
|
4 |
-
import sys
|
5 |
from pathlib import Path
|
6 |
|
7 |
import gradio as gr
|
8 |
import pandas as pd
|
9 |
import torch
|
10 |
-
from huggingface_hub import snapshot_download
|
11 |
|
12 |
-
from temps.archive import Archive
|
13 |
from temps.temps_arch import EncoderPhotometry, MeasureZ
|
14 |
from temps.temps import TempsModule
|
15 |
|
@@ -17,7 +14,7 @@ logger = logging.getLogger(__name__)
|
|
17 |
|
18 |
# Define the prediction function that will be called by Gradio
|
19 |
def predict(input_file_path: Path):
|
20 |
-
model_path = Path("
|
21 |
|
22 |
logger.info("Loading data and converting fluxes to colors")
|
23 |
|
@@ -107,4 +104,6 @@ interface = gr.Interface(
|
|
107 |
)
|
108 |
|
109 |
if __name__ == "__main__":
|
110 |
-
|
|
|
|
|
|
1 |
from __future__ import annotations
|
2 |
import argparse
|
3 |
import logging
|
|
|
4 |
from pathlib import Path
|
5 |
|
6 |
import gradio as gr
|
7 |
import pandas as pd
|
8 |
import torch
|
|
|
9 |
|
|
|
10 |
from temps.temps_arch import EncoderPhotometry, MeasureZ
|
11 |
from temps.temps import TempsModule
|
12 |
|
|
|
14 |
|
15 |
# Define the prediction function that will be called by Gradio
|
16 |
def predict(input_file_path: Path):
|
17 |
+
model_path = Path("models/")
|
18 |
|
19 |
logger.info("Loading data and converting fluxes to colors")
|
20 |
|
|
|
104 |
)
|
105 |
|
106 |
if __name__ == "__main__":
|
107 |
+
args = get_args()
|
108 |
+
logging.basicConfig(level=args.log_level)
|
109 |
+
interface.launch(server_name=args.server_address, server_port=args.port, share=True)
|