Spaces:
Sleeping
Sleeping
Commit
·
6d0902b
1
Parent(s):
946312b
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,12 @@ def predict_price(year, month, markets, food):
|
|
| 48 |
|
| 49 |
prediction = model.predict(input_data)
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
demo = gr.Interface(
|
|
@@ -61,6 +66,7 @@ demo = gr.Interface(
|
|
| 61 |
gr.Dropdown(choices=market, label="Market"),
|
| 62 |
gr.Dropdown(choices=commodity, label="Food Type")
|
| 63 |
],
|
| 64 |
-
outputs=
|
|
|
|
| 65 |
)
|
| 66 |
demo.launch(debug=True)
|
|
|
|
| 48 |
|
| 49 |
prediction = model.predict(input_data)
|
| 50 |
|
| 51 |
+
food_url = "https://raw.githubusercontent.com/TimiUU/wine/main" + food + ".png"
|
| 52 |
+
img = Image.open(requests.get(food_url, stream=True).raw)
|
| 53 |
+
|
| 54 |
+
return prediction, img
|
| 55 |
+
|
| 56 |
+
#return prediction, food_url
|
| 57 |
|
| 58 |
|
| 59 |
demo = gr.Interface(
|
|
|
|
| 66 |
gr.Dropdown(choices=market, label="Market"),
|
| 67 |
gr.Dropdown(choices=commodity, label="Food Type")
|
| 68 |
],
|
| 69 |
+
outputs=[gr.Textbox(), gr.Image()]
|
| 70 |
+
|
| 71 |
)
|
| 72 |
demo.launch(debug=True)
|