Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import openai
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
|
| 6 |
-
|
| 7 |
def gpt3(texts):
|
| 8 |
openai.api_key = apikeycode
|
| 9 |
|
|
@@ -24,18 +24,14 @@ def gpt3(texts):
|
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
def greet( prompt):
|
| 30 |
-
txt=
|
| 31 |
sql = gpt3(txt)
|
| 32 |
return sql
|
| 33 |
|
| 34 |
-
#the scrip variable is a string of python code with a sql query in it. execute the code keep the result in a variable
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
|
|
|
|
| 39 |
iface = gr.Interface(greet, inputs = ["text"], outputs = "text")
|
| 40 |
iface.launch()
|
| 41 |
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
|
| 6 |
+
#OpenAi call
|
| 7 |
def gpt3(texts):
|
| 8 |
openai.api_key = apikeycode
|
| 9 |
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
+
# Function to elicit sql response from model
|
|
|
|
| 28 |
def greet( prompt):
|
| 29 |
+
txt= HiddenPrompt
|
| 30 |
sql = gpt3(txt)
|
| 31 |
return sql
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
#Code to set up Gradio UI
|
| 35 |
iface = gr.Interface(greet, inputs = ["text"], outputs = "text")
|
| 36 |
iface.launch()
|
| 37 |
|