Spaces:
Runtime error
Runtime error
Julien Ajdenbaum
commited on
Commit
•
4e92983
1
Parent(s):
08b7f00
added shampoo question
Browse files- app.py +4 -3
- tmp/8642.png +0 -0
app.py
CHANGED
@@ -38,7 +38,7 @@ def pad(arr):
|
|
38 |
arr[i] = arr[i] + " "
|
39 |
return arr
|
40 |
|
41 |
-
def predict(file, age, parent, gp):
|
42 |
product = ['Computer', 'Monitor ', 'Laptop ', 'Printer ', 'Tablet ']
|
43 |
quantity = pad(np.array([320, 450, 300, 120, 280]) / 500)
|
44 |
min_normal = pad(np.array([250, 200, 210, 100, 250]) / 500)
|
@@ -50,7 +50,7 @@ def predict(file, age, parent, gp):
|
|
50 |
geneticRisks = ""
|
51 |
|
52 |
for variant, risk, percent in zip(variants, risks, percents):
|
53 |
-
geneticRisks += f"Variant {variant} detected, risk of {risk} is {percent} higher.\n"
|
54 |
|
55 |
useful_products = ("Hydrating Shampoo : https://www.thisisthebestshampooforyou.fr/fr-fr/\n"
|
56 |
"Light Hat : https://www.amazon.com/light-therapy-hat/s?k=light+therapy+hat")
|
@@ -66,7 +66,8 @@ iface = gr.Interface(
|
|
66 |
gr.File(value="tmp/metagenome.txt", type='file', label='Scalp sample'),
|
67 |
gr.Textbox(label='Age'),
|
68 |
gr.CheckboxGroup(choices=["Yes", "No", "Do not know"], label="Has the father experienced hair loss ?"),
|
69 |
-
gr.CheckboxGroup(choices=["0", "1", "2", "Do not know"], label="How many grand-parents have experienced hair loss ?")
|
|
|
70 |
],
|
71 |
outputs=[
|
72 |
gr.Image(label='Scalp Metagenomics Analysis Results'),
|
|
|
38 |
arr[i] = arr[i] + " "
|
39 |
return arr
|
40 |
|
41 |
+
def predict(file, age, parent, gp, shampoo):
|
42 |
product = ['Computer', 'Monitor ', 'Laptop ', 'Printer ', 'Tablet ']
|
43 |
quantity = pad(np.array([320, 450, 300, 120, 280]) / 500)
|
44 |
min_normal = pad(np.array([250, 200, 210, 100, 250]) / 500)
|
|
|
50 |
geneticRisks = ""
|
51 |
|
52 |
for variant, risk, percent in zip(variants, risks, percents):
|
53 |
+
geneticRisks += f"Variant {variant} detected, risk of {risk} is {percent}% higher.\n"
|
54 |
|
55 |
useful_products = ("Hydrating Shampoo : https://www.thisisthebestshampooforyou.fr/fr-fr/\n"
|
56 |
"Light Hat : https://www.amazon.com/light-therapy-hat/s?k=light+therapy+hat")
|
|
|
66 |
gr.File(value="tmp/metagenome.txt", type='file', label='Scalp sample'),
|
67 |
gr.Textbox(label='Age'),
|
68 |
gr.CheckboxGroup(choices=["Yes", "No", "Do not know"], label="Has the father experienced hair loss ?"),
|
69 |
+
gr.CheckboxGroup(choices=["0", "1", "2", "Do not know"], label="How many grand-parents have experienced hair loss ?"),
|
70 |
+
gr.Textbox(label='How many times a week do you wash your hair ?'),
|
71 |
],
|
72 |
outputs=[
|
73 |
gr.Image(label='Scalp Metagenomics Analysis Results'),
|
tmp/8642.png
ADDED