sherpal25 commited on
Commit
53be45e
·
1 Parent(s): 7ef774f

added model layer.

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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.")