Spaces:
Sleeping
Sleeping
Commit
·
a1d6bb6
1
Parent(s):
ad386f8
add text to text
Browse files
app.py
CHANGED
@@ -27,10 +27,12 @@ def get_ingridients(image):
|
|
27 |
return ', '.join(ingridients)
|
28 |
|
29 |
|
30 |
-
|
31 |
|
32 |
def get_reciepe(ingridients):
|
33 |
-
|
|
|
|
|
34 |
|
35 |
def get_answer(image):
|
36 |
ingridients = get_ingridients(image)
|
|
|
27 |
return ', '.join(ingridients)
|
28 |
|
29 |
|
30 |
+
text_to_text = pipeline("text-generation", model="ai-forever/mGPT")
|
31 |
|
32 |
def get_reciepe(ingridients):
|
33 |
+
question = 'what can i cook of ' + ingridients + '?'
|
34 |
+
answers = text_to_text(question)
|
35 |
+
return answers[0]['generated_text']
|
36 |
|
37 |
def get_answer(image):
|
38 |
ingridients = get_ingridients(image)
|