Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def gpt3(texts):
|
|
16 |
top_p=1,
|
17 |
frequency_penalty=0.0,
|
18 |
presence_penalty=0.0,
|
19 |
-
stop = ("#", "</code>")
|
20 |
)
|
21 |
x = response.choices[0].text
|
22 |
|
@@ -24,12 +24,12 @@ def gpt3(texts):
|
|
24 |
|
25 |
# Function to elicit regex response from model
|
26 |
def greet(prompt):
|
27 |
-
txt= (f
|
28 |
-
regex =
|
29 |
return regex
|
30 |
|
31 |
|
32 |
#Code to set up Gradio UI
|
33 |
-
iface = gr.Interface(greet, inputs = ["text"], outputs = "text",title="Natural Language to Regex
|
34 |
iface.launch()
|
35 |
|
|
|
16 |
top_p=1,
|
17 |
frequency_penalty=0.0,
|
18 |
presence_penalty=0.0,
|
19 |
+
stop = ("'","#", "</code>")
|
20 |
)
|
21 |
x = response.choices[0].text
|
22 |
|
|
|
24 |
|
25 |
# Function to elicit regex response from model
|
26 |
def greet(prompt):
|
27 |
+
txt= (f"""#---Regex Generator--- \n #Prompt: {prompt}\n#Regex String :\n#'""")
|
28 |
+
regex = gpt3(txt)
|
29 |
return regex
|
30 |
|
31 |
|
32 |
#Code to set up Gradio UI
|
33 |
+
iface = gr.Interface(greet, inputs = ["text"], outputs = "text",title="Natural Language to Regex ", description="Enter any prompt and get a regex statement back!")
|
34 |
iface.launch()
|
35 |
|