Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -2,21 +2,6 @@ import gradio as gr
|
|
| 2 |
import requests
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
-
"""# Step 1 from Semantic Search
|
| 6 |
-
from sentence_transformers import SentenceTransformer
|
| 7 |
-
import torch
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
# Step 2 from Semantic Search
|
| 11 |
-
with open("water_cycle.txt", "r", encoding="utf-8") as file:
|
| 12 |
-
# Read the entire contents of the file and store it in a variable
|
| 13 |
-
water_cycle_text = file.read()
|
| 14 |
-
|
| 15 |
-
# Print the text below
|
| 16 |
-
print(water_cycle_text)"""
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
SPOONACULAR_API_KEY = "71259036cfb3405aa5d49c1220a988c5"
|
| 21 |
|
| 22 |
def get_recipes(ingredient):
|
|
@@ -30,12 +15,11 @@ def get_recipes(ingredient):
|
|
| 30 |
data = res.json()
|
| 31 |
return [r["title"] for r in data["results"]]
|
| 32 |
|
| 33 |
-
print(data)
|
| 34 |
iface = gr.Interface(
|
| 35 |
fn=get_recipes,
|
| 36 |
inputs="text",
|
| 37 |
outputs="text",
|
| 38 |
-
title="
|
| 39 |
)
|
| 40 |
|
| 41 |
iface.launch()
|
|
@@ -100,4 +84,4 @@ demo = gr.ChatInterface(
|
|
| 100 |
|
| 101 |
|
| 102 |
if __name__ == "__main__":
|
| 103 |
-
demo.launch()
|
|
|
|
| 2 |
import requests
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
SPOONACULAR_API_KEY = "71259036cfb3405aa5d49c1220a988c5"
|
| 6 |
|
| 7 |
def get_recipes(ingredient):
|
|
|
|
| 15 |
data = res.json()
|
| 16 |
return [r["title"] for r in data["results"]]
|
| 17 |
|
|
|
|
| 18 |
iface = gr.Interface(
|
| 19 |
fn=get_recipes,
|
| 20 |
inputs="text",
|
| 21 |
outputs="text",
|
| 22 |
+
title="Spoonacular Recipe Finder"
|
| 23 |
)
|
| 24 |
|
| 25 |
iface.launch()
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
if __name__ == "__main__":
|
| 87 |
+
demo.launch()
|