Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,8 @@ from openai import OpenAI
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
|
| 8 |
def get_open_ai_output(recipe_titles):
|
| 9 |
food = recipe_titles
|
|
@@ -21,7 +21,7 @@ def inference(recipe_titles):
|
|
| 21 |
return output
|
| 22 |
|
| 23 |
demo = gr.Interface(fn=inference,
|
| 24 |
-
inputs=gr.
|
| 25 |
outputs=[gr.Textbox(label="Recipe", lines=20)],
|
| 26 |
title = """
|
| 27 |
|
|
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
api_key=os.getenv("OPENAI_API_KEY")
|
| 6 |
+
client = OpenAI(api_key=api_key)
|
| 7 |
|
| 8 |
def get_open_ai_output(recipe_titles):
|
| 9 |
food = recipe_titles
|
|
|
|
| 21 |
return output
|
| 22 |
|
| 23 |
demo = gr.Interface(fn=inference,
|
| 24 |
+
inputs=gr.Textbox(label="Ingredient"),
|
| 25 |
outputs=[gr.Textbox(label="Recipe", lines=20)],
|
| 26 |
title = """
|
| 27 |
|