feat: Add text as an output...
Browse files
app.py
CHANGED
|
@@ -32,11 +32,12 @@ def wine(type_white,fixed_acidity,volatile_acidity,citric_acid,residual_sugar,ch
|
|
| 32 |
columns=columns)
|
| 33 |
print("Predicting")
|
| 34 |
print(df)
|
| 35 |
-
res = model.predict(df)
|
|
|
|
| 36 |
print(res)
|
| 37 |
|
| 38 |
img = get_image_with_text(f'{res}')
|
| 39 |
-
return img
|
| 40 |
|
| 41 |
demo = gr.Interface(
|
| 42 |
fn=wine,
|
|
@@ -55,6 +56,10 @@ demo = gr.Interface(
|
|
| 55 |
gr.Number(value=0.9950, label=columns[8]),
|
| 56 |
gr.Number(value=10.0, label=columns[9]),
|
| 57 |
],
|
| 58 |
-
outputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
demo.launch(debug=True)
|
|
|
|
| 32 |
columns=columns)
|
| 33 |
print("Predicting")
|
| 34 |
print(df)
|
| 35 |
+
res = model.predict(df)
|
| 36 |
+
res_text = f'the predicted quality of your wine was {res}'
|
| 37 |
print(res)
|
| 38 |
|
| 39 |
img = get_image_with_text(f'{res}')
|
| 40 |
+
return img,res_text
|
| 41 |
|
| 42 |
demo = gr.Interface(
|
| 43 |
fn=wine,
|
|
|
|
| 56 |
gr.Number(value=0.9950, label=columns[8]),
|
| 57 |
gr.Number(value=10.0, label=columns[9]),
|
| 58 |
],
|
| 59 |
+
outputs=[
|
| 60 |
+
gr.Image(type="pil"),
|
| 61 |
+
gr.Text(),
|
| 62 |
+
]
|
| 63 |
+
)
|
| 64 |
|
| 65 |
demo.launch(debug=True)
|