Spaces:
Sleeping
Sleeping
Update app/main.py (#60)
Browse files- Update app/main.py (adfd6a713585f5fbab54038d3c02654a63e9078d)
Co-authored-by: Axel Rousseau <axelrvite@users.noreply.huggingface.co>
- app/main.py +3 -3
app/main.py
CHANGED
|
@@ -55,13 +55,13 @@ async def predict(file: UploadFile = File(...)):
|
|
| 55 |
try:
|
| 56 |
# Sauvegarde du fichier uploadé
|
| 57 |
with open(temp_filepath, "wb") as buffer:
|
| 58 |
-
|
| 59 |
|
| 60 |
# Lecture des points expérimentaux
|
| 61 |
exp_points = read_iv_csv(temp_filepath)
|
| 62 |
|
| 63 |
# Analyse par méthode classique (Random)
|
| 64 |
-
fit_random = Fit_IV(temp_filepath, ",", type_fit="RANDOM", temperature)
|
| 65 |
params_random = {
|
| 66 |
"Rsh": fit_random.params_fit["Rsh"],
|
| 67 |
"Rs": fit_random.params_fit["Rs"],
|
|
@@ -73,7 +73,7 @@ async def predict(file: UploadFile = File(...)):
|
|
| 73 |
ssd_random = fit_random.ssd_fit
|
| 74 |
|
| 75 |
# Analyse par méthode génétique
|
| 76 |
-
fit_genetique = Fit_IV(temp_filepath, ",", type_fit="GENETIQUE", temperature)
|
| 77 |
params_genetique = {
|
| 78 |
"Rsh": fit_genetique.params_fit["Rsh"],
|
| 79 |
"Rs": fit_genetique.params_fit["Rs"],
|
|
|
|
| 55 |
try:
|
| 56 |
# Sauvegarde du fichier uploadé
|
| 57 |
with open(temp_filepath, "wb") as buffer:
|
| 58 |
+
temp = shutil.copyfileobj(file.file, buffer)
|
| 59 |
|
| 60 |
# Lecture des points expérimentaux
|
| 61 |
exp_points = read_iv_csv(temp_filepath)
|
| 62 |
|
| 63 |
# Analyse par méthode classique (Random)
|
| 64 |
+
fit_random = Fit_IV(temp_filepath, ",", type_fit="RANDOM", temp = temperature)
|
| 65 |
params_random = {
|
| 66 |
"Rsh": fit_random.params_fit["Rsh"],
|
| 67 |
"Rs": fit_random.params_fit["Rs"],
|
|
|
|
| 73 |
ssd_random = fit_random.ssd_fit
|
| 74 |
|
| 75 |
# Analyse par méthode génétique
|
| 76 |
+
fit_genetique = Fit_IV(temp_filepath, ",", type_fit="GENETIQUE", temp=temperature)
|
| 77 |
params_genetique = {
|
| 78 |
"Rsh": fit_genetique.params_fit["Rsh"],
|
| 79 |
"Rs": fit_genetique.params_fit["Rs"],
|