added model layer.
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This is the main logic file that contains hugging face model interaction
|
| 2 |
+
|
| 3 |
+
# This model is for detecting food in the image.
|
| 4 |
+
# Use a pipeline as a high-level helper
|
| 5 |
+
from transformers import pipeline
|
| 6 |
+
|
| 7 |
+
pipe = pipeline("image-classification", model="microsoft/resnet-50")
|
| 8 |
+
result = pipe("./man-holding-banana.jpeg")
|
| 9 |
+
print(result[0]['label'])
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
pipe = pipeline("text-generation", model="tiiuae/falcon-7b-instruct", trust_remote_code=True)
|
| 13 |
+
result = pipe("what can I make with apple, orange, and potato?")
|
| 14 |
+
print("this is the query result.")
|